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

1.0.2 • Public • Published

Simple Typescript logger fot internal purpose

log levels

  1. debug
  2. info
  3. warn
  4. error you can cut off logs above e.g. info

there are transport:

  • console
  • elasticsearch

install

npm i @bitclave/logger
  1. create your app logger you will import one to your app files
import { Logger, Level, ILoggerOptions, consoleTransport } from '@bitclave@/logger'
const options: ILoggerOptions = {
    applicationNameLabel: 'logger NPM package',
    transports:[consoleTransport],
    level: Level.debug
}
const logger = new Logger(options);
  1. create logger in your file
const log = logger.factoryServerSide(module);

use logger serverside

log.error('Console transport test');

the most common case is text message, but sometimes...

attach errors and stack

Readme

Keywords

Package Sidebar

Install

npm i @antbat/logger

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

26.1 kB

Total Files

28

Last publish

Collaborators

  • avisioner