6.0.0 • Published 2 years ago

cf-logger-p v6.0.0

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

CF-Logger-Package

CF-Logger-Package contains Logging methods that can be utilized as a unified logging mechanism across all cf codebase.

Logging Levels

The supported logging levels are listed down based on priority.

  • error: 0
  • info: 1
  • debug: 2
  • warning: 3

Built With

Technologies & plugins used to create this application

Using This Private Repository as a Dependency

Prerequisites

1. Setup node & npm

This is an example of how to list things you need to use the application and how to install them.

1. Install the package

Install this package using the following command:

Then install your dependencies using the command
```bash
npm install cf-logger-package

Usage

// Import package
import LoggerOps from 'cf-logger-package'

// Create Logger instance & pass the logging level you want to set
const Logger = new LoggerOps('error')

//create a middleware function  to attach a traceid with reach API request
app.use(function (req, res, next) {
    Logger.setTraceId(uuidv4());
    next();
  })

// Use the following methods to log data
//Debug: The debug log should be created in the local & development environments. It should contain the information which will help developers to debug a problem. The following method can be used for the same:

Logger.logDebug(msg: string, obj: object)


//Error: The error log should be created in all environments in case of occurrence of an error. This can usually be implemented in the places where you are catching errors.The following method can be used for the same:

Logger.logError(msg: string, obj: object)

//Info: The info log should be created in the local & development environments. It should contain the information which will help developers to determine the current state of the application & informational statements regarding program execution. It can be used for application behaviour tracking. The following method can be used for the same:

Logger.logInfo(msg: string, obj: object)


//* Warning: The warning log should be created in the local & development environments. It should contain the information which will help developers to determine potentially harmful state of the application in real time but may not terminate the existing functionality or application processing.

Logger.logWarning(msg: string, obj: object)


// All the log methods accept two parameters :
// 1. Message:(dataType: string)
// 2. Metadata: (dataType: object) 

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

6.0.0

2 years ago

4.0.0

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.4.0

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago