1.0.5 • Published 5 months ago

sc_logger v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

SC_Logger (Simple Console Logger) for Node.js

This lightweight Node.js logging module uses ANSI escape sequences to provide colored and formatted output in the console. It supports different log levels (WARN, ERROR, DEBUG, INFO) and allows you to easily customize the appearance of log messages.

FunctionDescription
logWarn(message, ...args)Displays a warning message in the console.
logError(message, ...args)Displays an error message in the console.
logDebug(message, ...args)Displays a debug message in the console.
logInfo(message, ...args)Displays an informative message in the console.

Usage

  1. Installation:

    Install the module using npm:

    npm install my-logger
  2. Use:

    import { logDebug, logError, logInfo, logWarn } from "sc_logger"
    
    logWarn("This is a warning message")
    logError("This is an error message")    
    logDebug("This is a debug message")
    logInfo("This is an informative message")

This is a simple way to log message using the logger, also u can pass parameters to the logger. 3. Use - Passing params:

```javascript
import { logDebug, logError, logInfo, logWarn } from "sc_logger"
logWarn("This is a warning message {}, {}", arg1, arg2)
logError("This is an error {} - message", arg)    
logDebug("This is {} a  {} debug {} message", [arg1, arg2, arg3] )
logInfo("This is an informative message")

ANSI Colors Used

  • WARN: Yellow (\u001B[33m).
  • ERROR: Red (\u001B[31m).
  • DEBUG: Green (\u001B[32m).
  • INFO: Gray (\u001B[90m).
1.0.5

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago