2023-07-27 17:05:56 +02:00
|
|
|
import Logger from '@joplin/utils/Logger';
|
2020-10-09 19:35:46 +02:00
|
|
|
|
|
|
|
export default class BaseService {
|
|
|
|
|
2023-03-06 16:22:01 +02:00
|
|
|
public static logger_: Logger = null;
|
2020-11-12 21:13:28 +02:00
|
|
|
protected instanceLogger_: Logger = null;
|
2020-10-09 19:35:46 +02:00
|
|
|
|
2023-03-06 16:22:01 +02:00
|
|
|
public 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
|
|
|
|
2023-03-06 16:22:01 +02:00
|
|
|
public setLogger(v: Logger) {
|
2020-08-02 13:28:50 +02:00
|
|
|
this.instanceLogger_ = v;
|
|
|
|
}
|
2018-03-15 20:08:46 +02:00
|
|
|
}
|