1.0.0 • Published 2 years ago

@david.uhlir/log v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Log util for node.js applications

This util can override console, also it can handle multiple outpus, like console and file together. You can extends LogHandler and add it to handlers to create your own output (like send to some api).

Example of initialization:

import { Log, LogConsoleHandler, LogFileHandler } from '@david.uhlir/log'

// configure log
Log.configure({
  handlers: [
    new LogConsoleHandler(),
    new LogFileHandler('./log/runtime.log'),
  ]
})

// override console
Log.overrideConsole()

And then just use console.log, console.warn, console.error, etc...

ISC