2019-03-29 06:13:14 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2020-04-06 03:30:08 -04:00
|
|
|
import {Logger, LogLevel} from '../../src/logging/logger';
|
2019-03-29 06:13:14 -04:00
|
|
|
|
|
|
|
export class MockLogger implements Logger {
|
2020-03-05 05:42:28 -05:00
|
|
|
constructor(public level = LogLevel.info) {}
|
|
|
|
|
|
|
|
logs: {[P in Exclude<keyof Logger, 'level'>]: string[][]} = {
|
2019-04-06 10:35:13 -04:00
|
|
|
debug: [],
|
|
|
|
info: [],
|
|
|
|
warn: [],
|
|
|
|
error: [],
|
|
|
|
};
|
2020-04-06 03:30:08 -04:00
|
|
|
debug(...args: string[]) {
|
|
|
|
this.logs.debug.push(args);
|
|
|
|
}
|
|
|
|
info(...args: string[]) {
|
|
|
|
this.logs.info.push(args);
|
|
|
|
}
|
|
|
|
warn(...args: string[]) {
|
|
|
|
this.logs.warn.push(args);
|
|
|
|
}
|
|
|
|
error(...args: string[]) {
|
|
|
|
this.logs.error.push(args);
|
|
|
|
}
|
2019-03-29 06:13:14 -04:00
|
|
|
}
|