wf-logging-toolbox
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

wf-logging-toolbox

Logging utility library for Node.js Output messages to the default console with log level, timestamp and user

Index

Installation

  • This library/package can be easily installed by running npm install wf-logging-toolbox --save

Dependencies

  • Node modules:
    • moment

Examples

  • Using javascript
const { wfLoggingToolbox } = require('wf-logging-toolbox');

const loggerInUTC = new wfLoggingToolbox(null)
const loggerInEST = new wfLoggingToolbox('America/New_York')

loggerInUTC.info('This is my message', 'my_user')
//Expected result: [INFO] [2022-07-24 19:47:19] [my_user] This is my message

loggerInEST.info('This is my message', 'my_user')
//Expected result: [INFO] [2022-07-24 15:47:19] [my_user] This is my message
  • Using typescript
import { wfLoggingToolbox } from 'wf-logging-toolbox'

const loggerInUTC = new wfLoggingToolbox(null)
const loggerInEST = new wfLoggingToolbox('America/New_York')

loggerInUTC.info('This is my message', 'my_user')
//Expected result: [INFO] [2022-07-24 19:47:19] [my_user] This is my message

loggerInEST.info('This is my message', 'my_user')
//Expected result: [INFO] [2022-07-24 15:47:19] [my_user] This is my message

License

  • This library is licensed under GNU General Public License v.3.0
  • Please check the license content here

Uninstallation

  • This library/package can be easily uninstalled by running npm uninstall wf-logging-toolbox

Readme

Keywords

Package Sidebar

Install

npm i wf-logging-toolbox

Weekly Downloads

1

Version

1.0.4

License

GPL-3.0

Unpacked Size

53.2 kB

Total Files

14

Last publish

Collaborators

  • leonardonevesduarte