@david.uhlir/log
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @david.uhlir/log

Weekly Downloads

16

Version

1.0.0

License

ISC

Unpacked Size

36.7 kB

Total Files

40

Last publish

Collaborators

  • david.uhlir