Skip to content

paulshryock/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@paulshryock/logger

⚠️ This project is in early development and not for production use.

PSR-3-compliant logger for Node.js.

Total size is less than 9 KiB.

Latest version badge npm bundle size npm downloads badge Socket badge GitHub License

Requirements

Software Minimum Version
Node 18.x

Installation

npm install @paulshryock/logger

API

Usage examples

import { CommandLineLogger, Logger } from '@paulshryock/logger'

class MyClass {
    #logger: Logger

    public constructor(logger: Logger) {
        this.#logger = logger
    }

    public logMessages(): void {
        this.#logger.emergency('System is unusable.')
        this.#logger.alert('Action must be taken immediately.')
        this.#logger.critical('Critical conditions.')
        this.#logger.error('Runtime error.')
        this.#logger.warn('Exceptional occurrence that is not an error.')
        this.#logger.notice('Normal but significant event.')
        this.#logger.info('Interesting event.')
        this.#logger.debug('Detailed debug information.')
    }
}

new MyClass(new CommandLineLogger())

Support

Contributing

Contributions are welcome! Read the contribution guidelines, and then submit a pull request.

Maintainers

License

MIT License