@modrgg/logger
v1.0.2
Published
The official logger for [Modr](https://modr.gg). Created by [doge](https://github.com/tbnritzdoge).
Downloads
1
Readme
@modrgg/logger
The official logger for Modr. Created by doge.
Features
- Extremely fast
- Fully ready for TypeScript
- Includes ESM ready entrypoint
Installation
Note: @modrgg/logger
requires Node 18 or higher to run.
npm install @modrgg/logger
yarn add @modrgg/logger
pnpm install @modrgg/logger
Examples
Creating a simple logger:
import { Logger } from '@modrgg/logger';
const logger = new Logger('your_app_name');
logger.info('Some information here!');
logger.warn('Some warning here!');
logger.error('Some error here!');
logger.debug('Some verbose log here!');
Creating a logger with a custom scope:
import { Logger, config } from '@modrgg/logger';
const logger = new Logger('your_app_name');
const cfg = config({ name: 'file_manager' });
// Outputs: <HH:MM:SS> <DD-MM-YYYY> INFO <PID> (your_app_name:file_manager): Loaded all files!
logger.info(cfg, 'Loaded all files!');
License
Licensed under GNU GPLv3.