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

2.0.1 • Public • Published
NPM Discord GPL-3.0-only

Pretty-print utility logger for JS/TS

@evilkiwi/logger provides a small interface on top of the existing console API and includes things such as:

  • Automatic code highlighting via `template literal` syntax
  • High-precision timestamps
  • Namespacing and Instanced Loggers
  • Enable/disable logging at runtime

Installation

This package is available via NPM:

yarn add @evilkiwi/logger

# or

npm install @evilkiwi/logger

Usage

Since version 2.0.0, there are no global logger exports. Instead, you must always create a logger instance:

import { createLogger } from '@evilkiwi/logger';

const loggerA = createLogger({
  name: 'module-a',
  color: '#FF0000',
});
const loggerB = createLogger({
  name: 'module-b',
  color: '#00FF00',
});

loggerA.debug('hello world A!');
loggerA.error('hello world B!');

Package Sidebar

Install

npm i @evilkiwi/logger

Weekly Downloads

36

Version

2.0.1

License

GPL-3.0-only

Unpacked Size

40.5 kB

Total Files

8

Last publish

Collaborators

  • oyed