ts-dev-logger
v0.1.5
Published
A development tool that allows you to log data to the console and to the file.
Downloads
2
Maintainers
Readme
Installation
npm i ts-dev-logger
or
yarn add ts-dev-logger
Logger - params
- dateType:
- UTCDate
- FullDate (default)
- ShortTime
- Time
Quick Guide - console
-- Basic Usage --
export const logger = new Logger({dateType: 'Time'})
const consoleLogger = new ConsoleLogger()
logger.constructLogger(consoleLogger)
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'ERROR'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'WARNING'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'INFO'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'NOTICE'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'OK'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'CRIT'})
-- Result --
Quick Guide - file
-- File Params --
- path — relative path to create logs folders (default: "./logs")
-- Basic Usage --
export const logger = new Logger({dateType: 'Time'})
const fileLogger = new FileLogger({})
logger.constructLogger(fileLogger)
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'ERROR'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'WARNING'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'INFO'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'NOTICE'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'OK'})
logger.log({message: 'Lorem Ipsum is simply dummy text', type: 'CRIT'})
-- Result --
Contributing
We welcome all types of contributions, either code fixes, new features or doc improvements. Code formatting is enforced by prettier. For commits please follow conventional commits convention. All code must pass lint rules and test suites before it can be merged into develop.
License
ts-dev-logger is licensed under the Apache License, Version 2.0.