2020-11-05 16:58:23 +00:00
|
|
|
import Logger from '../Logger';
|
2020-10-09 18:35:46 +01:00
|
|
|
|
|
|
|
export default class BaseService {
|
|
|
|
|
2020-11-12 19:13:28 +00:00
|
|
|
static logger_: Logger = null;
|
|
|
|
protected instanceLogger_: Logger = null;
|
2020-10-09 18:35:46 +01:00
|
|
|
|
2020-11-12 19:13:28 +00:00
|
|
|
logger(): Logger {
|
2020-08-02 12:28:50 +01:00
|
|
|
if (this.instanceLogger_) return this.instanceLogger_;
|
2018-03-15 18:08:46 +00:00
|
|
|
if (!BaseService.logger_) throw new Error('BaseService.logger_ not set!!');
|
|
|
|
return BaseService.logger_;
|
|
|
|
}
|
2020-08-02 12:28:50 +01:00
|
|
|
|
2020-11-12 19:13:28 +00:00
|
|
|
setLogger(v: Logger) {
|
2020-08-02 12:28:50 +01:00
|
|
|
this.instanceLogger_ = v;
|
|
|
|
}
|
2018-03-15 18:08:46 +00:00
|
|
|
}
|