diff --git a/src/logger.ts b/src/logger.ts index 572f3a3..f43d18d 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,8 +1,11 @@ import { LogLevel, DEBUG, - NOTSET, + INFO, WARNING, + ERROR, + CRITICAL, + NOTSET, checkLevel, } from './log-level'; import { @@ -173,6 +176,34 @@ export class Logger extends Filterer { if (this.isEnabledFor(DEBUG)) { this._log(DEBUG, msg, options) } } + /** + * Log 'msg % args' with severity 'INFO' + */ + public info(msg: string, options?: LogOptions) { + if (this.isEnabledFor(INFO)) { this._log(INFO, msg, options) } + } + + /** + * Log 'msg % args' with severity 'WARNING' + */ + public warning(msg: string, options?: LogOptions) { + if (this.isEnabledFor(WARNING)) { this._log(WARNING, msg, options) } + } + + /** + * Log 'msg % args' with severity 'ERROR' + */ + public error(msg: string, options?: LogOptions) { + if (this.isEnabledFor(ERROR)) { this._log(ERROR, msg, options) } + } + + /** + * Log 'msg % args' with severity 'CRITICAL' + */ + public critical(msg: string, options?: LogOptions) { + if (this.isEnabledFor(CRITICAL)) { this._log(CRITICAL, msg, options) } + } + /** * A factory method which can be overriden in subclasses to create * specialized LogRecords.