ts-hello-world-demo
v0.0.1
Published
This is a toy project to learn how to create a nuw NPM package with TypeScript
Downloads
2
Readme
HageLogger
HageLogger is a class that provides simple logging functionality.
Usage
- Import the
HageLogger
class.
import HageLogger from './HageLogger';
1.Create an instance of HageLogger.
const logger = new HageLogger();
2.Use the log method to output logs. You can specify the log level and message. Optionally, you can also specify whether to include a timestamp.
logger.log({ level: LogLevel.INFO, message: 'This is an information message.', timestamp: true });
logger.log({ level: LogLevel.WARN, message: 'This is a warning message.' });
logger.log({ level: LogLevel.ERROR, message: 'This is an error message.', timestamp: true });
Logs will be output to both the console and a file.