export class ConsoleLoggerService {
    constructor() {
        this.isErrorEnabled = () => true;
        this.isWarnEnabled = () => true;
        this.isInfoEnabled = () => true;
        this.isDebugEnabled = () => true;
        this.isLogEnabled = () => true;
    }
    error(message, optionalParams) {
        if (this.isErrorEnabled()) {
            console.error.apply(console, optionalParams ? [message, optionalParams] : [message]);
        }
    }
    warn(message, optionalParams) {
        if (this.isWarnEnabled()) {
            console.warn.apply(console, optionalParams ? [message, optionalParams] : [message]);
        }
    }
    info(message, optionalParams) {
        // eslint-disable-next-line no-console
        if (this.isInfoEnabled()) {
            console.info.apply(console, optionalParams ? [message, optionalParams] : [message]);
        }
    }
    debug(message, optionalParams) {
        if (!this.isDebugEnabled()) {
            return;
        }
        // For browsers that don't implement the debug method, log will be used instead.
        // eslint-disable-next-line no-console
        console[console['debug'] ? 'debug' : 'log'].apply(console, optionalParams ? [message, optionalParams] : [message]);
    }
    log(message, optionalParams) {
        if (this.isLogEnabled()) {
            console.log.apply(console, optionalParams ? [message, optionalParams] : [message]);
        }
    }
}
