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