streamlogs
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

Streamlogs.js

  • Manages logs by using node.js streams and events.
  • levels: trace, debug, info, warn, error, fatal
  • You can add listeners to logs

Objects

Object Description
basicLogger Readable stream sending logs in .log style. Support for colors
JSONlogger Same as basicLogger, but in JSON format
defLog Default instance of basicLogger, pipes into stdout, can be shared between modules
logLevel enum of log levels

Examples

Using default logger (that pipes to console)

const { defLog } = require("streamlogs")

defLog.info("Hello world!", "user")

New logger pipes into standard output

const logger = require("streamlogs")
const log = new logger.basicLogger()
log.pipe(process.stdout)

log.addLog("Hello world!", logger.logLevel.info, "user")

You can also use ECMAscript

import { defLog } from "streamlogs"

defLog.info("Hello world!", "user")

/streamlogs/

    Package Sidebar

    Install

    npm i streamlogs

    Weekly Downloads

    7

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    34.9 kB

    Total Files

    13

    Last publish

    Collaborators

    • czmatyaszero