[ADF-2477] add new log component in demo shell (#3129)

* add CTRL + L new log component in demo shell to test the log service bus

* remove trivial definition

* close tag app-log
This commit is contained in:
Eugenio Romano
2018-03-29 11:04:33 +01:00
committed by GitHub
parent 99abef0b0a
commit d6f51c22aa
6 changed files with 105 additions and 12 deletions

View File

@@ -25,21 +25,20 @@ import { Subject } from 'rxjs/Subject';
@Injectable()
export class LogService {
currentLogLevel: LogLevelsEnum = LogLevelsEnum.TRACE;
get currentLogLevel() {
let configLevel: string = this.appConfig.get<string>('logLevel');
if (configLevel) {
return this.getLogLevel(configLevel);
}
return LogLevelsEnum.TRACE;
}
onMessage: Subject<any>;
constructor(appConfig: AppConfigService) {
constructor(private appConfig: AppConfigService) {
this.onMessage = new Subject();
if (appConfig) {
let configLevel: string = appConfig.get<string>('logLevel');
if (configLevel) {
this.currentLogLevel = this.getCurrentLogLevel(configLevel);
}
}
}
error(message?: any, ...optionalParams: any[]) {
@@ -117,7 +116,7 @@ export class LogService {
}
}
getCurrentLogLevel(level: string): LogLevelsEnum {
getLogLevel(level: string): LogLevelsEnum {
let referencedLevel = logLevels.find((currentLevel: any) => {
return currentLevel.name.toLocaleLowerCase() === level.toLocaleLowerCase();
});