@acelikesghosts/logger
TypeScript icon, indicating that this package has built-in type declarations

0.0.2-RC • Public • Published

Logger

a simplistic logger for general purposes, wrapper around console

Examples

CJS:

const Logger = require('@AceLikesGhosts/Logger');

const logger = new Logger('prefix', void 0 /** default colors */, 'sub:prefix' /** optional */);
// prefix = "sub:prefix:prefix"
logger.info('hello!'); // same as `logger.log('hello!');`
logger.warn('uh oh!');
logger.trace('im here!');

Typescript:

import Logger from '@AceLikesGhosts/Logger';
import type { Colors } from '@AceLikesGhosts/Logger';

const colors = {
    // prefix: 'purple' -> or hex
    // etc,,,
} satisfies Colors;

const logger = new Logger('prefix', colors /** or `void 0` for defaults */, 'sub:prefix' /** optional */);
logger.info('hello!'); // same as `logger.log('hello!');`
logger.warn('uh oh!');
logger.trace('im here!');

Readme

Keywords

Package Sidebar

Install

npm i @acelikesghosts/logger

Weekly Downloads

2

Version

0.0.2-RC

License

MIT

Unpacked Size

8.33 kB

Total Files

5

Last publish

Collaborators

  • acelikesghosts