Linkta-org / sandbox

Sandbox sprint repo for core functionality prototype
MIT License
3 stars 1 forks source link

Implemented log4js with log level config #27

Closed relandboyle closed 3 months ago

relandboyle commented 4 months ago

Description

Added a logging library to nudge the project toward a robust, release-ready application. Rather than using console.log(), try using log4js!

import { getLogger } from 'log4js';
const logger = getLogger("[???]");

Replace ??? with the name of the file or method you are logging from.

const logger = getLogger("[Linkta Server]");
logger.debug("Hello World!");
logger.info("Hello World!");
logger.warn("Hello World!");
logger.error("Hello World!");
logger.fatal("Hello World!");

Screenshot 2024-05-16 181231

Create a LOG_LEVEL environment variable to override the default "info" level.

Fixes #26

Type of change

How Has This Been Tested?

Checklist:

Additional Information:

ChTiSh commented 3 months ago

Looks good!!!!