Another console logger library
Because I like reinventing the wheel :)
Use your favourite package manager, idk
npm install @ntf/logger
yarn add @ntf/logger
pnpm install @ntf/logger
This library can be used in CommonJS
and ESModule
environments
const { ... } = require("@ntf/logger");
import { ... } from "@ntf/logger";
For NodeJS there's AnsiLogger
class which you can guess, uses escaped ansi code for colors in termnial/console/command prompt/whatever terminal name
For Browser there's CSSLogger
class which uses the cool feature of CSS styling, you can try AnsiLogger
but on some browsers it looks weird (especially Chrome)
Just extend the Logger
class and implement print
:
class MyCoolAndAwesomeLogger extends Logger
{
// level = can be "info", "warn", "error", "debug" or "trace"
// args = well... anything... literally
print(level,...args)
{
// do some funny stuff here
}
};
Just like any Open Source Project this has a License, the MIT License