Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

starry-comet/comet-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

comet-logger

roles

This project has to main goal to provide a logger to the ioc container from comet-ioc

Usage

import {inject, injectable} from 'comet-ioc'
import {Logger, LoggerModule, LayerToken, layers} from 'comet-logger'

@injectable()
class App {
  public constructor(
    @inject(Logger) private $logger: Logger
  ) {
    this.$logger.info('info')
    this.$logger.error('info')
    this.$logger.warn('info')
    this.$logger.debug('info')
    this.$logger.silly('info')
  }
}

bootstrap(App, {
  imports: [LoggerModule],
  constants: [{
    provide: LayerToken,
    useValue: new layers.Console()
  }]
})

results:

info: info
error: info
warn: info
debug: info
silly: info