rklogger
Version:
RKLogger is a lightweight JavaScript library designed for efficient and visually appealing logging. It offers developers the ability to produce logs, utilizing distinct colors to represent different log levels for improved readability and comprehension.
45 lines (36 loc) • 1.57 kB
Markdown
> RKLogger is a lightweight JavaScript library designed for efficient and visually appealing logging. It offers developers the ability to produce logs, utilizing distinct colors to represent different log levels for improved readability and comprehension.


- Supports different log levels: General, Info, Trace, Debug, Warning, Error, and Fatal.
- Color-coded console output for easy readability.
- Configurable stack trace logging.
- Supports timestamp formatting with optional milliseconds.
- Reads configuration from environment variables.
```
npm i rklogger
```
```shell
printFatal('This is a FATAL log output', [object]);
printError('This is a ERROR log output');
printWarning('This is an WARNING log output');
printDebug('This is a DEBUG log output');
printTrace('This is a TRACE log output');
printGeneral('This is a GENERAL log output');
printInfo('This is a INFO log output');
```

In the .env file of the project, the following parameters can be configured to customize RKLogger, or no settings can be made at all. By default, RKLogger will operate in the UTC time zone, format timestamps using en-US, and print all DEBUG messages.
```dotenv
PRINT_DEBUG=true
PRINT_STACK_DETAIL=true
CONSOLE_LOCALE='en-GB'
CONSOLE_TIMEZONE='Australia/Melbourne'
SUPPORT_MILLISECONDS=true
```