Logging package for my projects
Go to file
2022-11-07 14:00:42 +02:00
src forgot to add the dynamic funcs to the client 2022-11-07 14:00:42 +02:00
test dynamically make the logging funcs based on types 2022-11-07 13:50:04 +02:00
.eslintrc.json Logging package 2022-11-05 17:31:54 +02:00
.gitignore bugfix, test & readme 2022-11-06 17:21:10 +02:00
index.js Logging package 2022-11-05 17:31:54 +02:00
package.json dynamically make the logging funcs based on types 2022-11-07 13:50:04 +02:00
README.md add options documentation to readme 2022-11-07 13:49:01 +02:00
yarn.lock Logging package 2022-11-05 17:31:54 +02:00

Navy's logger

Simple logger I wrote to have a unified system for logging throughout my projects.

TODO

  • Automatic file rotation, currently only rotates files on startup
  • Discord webhook, need to write a separate package for that, don't want to add the entirety of d.js as a dep just for a webhook

Features

Split into Master and Client for logging between processes, where master resides on the master process and the clients on the spawned processes.
Should be fairly trivial to modify it to work across nodes with websockets.

Logger Options

{ 
    customTypes: [], // Log types, defaults are 'error', 'warn', 'info', 'debug', 'status'. Each one of these has an associated shorthand function, the custom ones will receive one too, e.g. adding 'access' to the custom types will add a logger.access() function
    customStreams: [], // File streams, by default there are streams for error and default
    customTypeMapping: {}, // This maps a type to a stream, e.g. adding "warn": "error" will pipe any warnings to the error log file
    customColors: {}, // Supports any colours chalk.js supports, e.g. "warn": "green" will turn warning outputs green
    debug: false 
}