import BaseLogger from "./BaseLogger" ; import { ILogger } from "./Interfaces" ; import { ArgumentNullException } from "../Errors" ; export class CompoundLogger extends BaseLogger { private _loggers : ILogger [ ] ; constructor ( logLevel , loggers ) { super ( logLevel ) ; if ( ! loggers ) { throw new ArgumentNullException ( "loggers" ) ; } this . _loggers = loggers ; } logMessage ( severity , message ) { this . _loggers . forEach ( ( logger ) => { logger . logMessage ( severity , message ) ; } ) ; } logException ( error ) { this . _loggers . forEach ( ( logger ) => { logger . logException ( error ) ; } ) ; } } export default CompoundLogger ;