Got rid of some warnings.
This commit is contained in:
parent
077cb2ee21
commit
f296c6fe26
2 changed files with 10 additions and 7 deletions
|
@ -5,24 +5,26 @@ import _ from 'lodash';
|
|||
export type LoggingFunction = (...args: any[]) => void;
|
||||
|
||||
const noopTaggedLogger: TaggedLogger = {
|
||||
log(level: LogLevel, ...args: any[]): void {},
|
||||
debug(...args: any[]): void {},
|
||||
info(...args: any[]): void {},
|
||||
warn(...args: any[]): void {},
|
||||
error(...args: any[]): void {},
|
||||
profile(...args: any[]): void {},
|
||||
log(_level: LogLevel, ..._args: any[]): void {},
|
||||
debug(..._args: any[]): void {},
|
||||
info(..._args: any[]): void {},
|
||||
warn(..._args: any[]): void {},
|
||||
error(..._args: any[]): void {},
|
||||
profile(..._args: any[]): void {},
|
||||
};
|
||||
|
||||
export interface ActivatableLogger extends Logger {
|
||||
init(enabled: boolean, loggingFunction?: LoggingFunction): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Check if LoggingConfig.debug and LoggingConfig.profile are handled.
|
||||
*/
|
||||
export class ActivatableLoggerImpl implements ActivatableLogger {
|
||||
private enabled: boolean = false;
|
||||
private loggingFunction: LoggingFunction = console.info;
|
||||
|
||||
init(enabled: boolean, loggingFunction?: LoggingFunction): void {
|
||||
const config = require('./config').config;
|
||||
this.enabled = enabled;
|
||||
this.loggingFunction = loggingFunction || console.info;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// ATTENTION: Those constraints are no longer the same file as for the client / admin interface.
|
||||
// Make sure changes are also reflected in /shared/validation/constraints.js.
|
||||
|
||||
// noinspection RegExpSimplifiable
|
||||
const CONSTRAINTS = {
|
||||
id:{
|
||||
type: 'string',
|
||||
|
|
Loading…
Reference in a new issue