Merge pull request #1407 from microsoft/hectorhdzg/corelogger

Adding logger during core constructor
This commit is contained in:
Hector Hernandez 2020-10-16 13:44:06 -07:00 коммит произвёл GitHub
Родитель c1e444a6d7 a0bcfece69
Коммит c34068a86b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 7 добавлений и 8 удалений

Просмотреть файл

@ -44,6 +44,11 @@ export class BaseCore implements IAppInsightsCore {
dynamicProto(BaseCore, this, (_self) => {
_self._extensions = new Array<IPlugin>();
_channelController = new ChannelController();
_self.logger = CoreUtils.objCreate({
throwInternal: (severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct = false) => { },
warnToConsole: (message: string) => { },
resetInternalMessageCount: () => { }
});
_eventQueue = [];
_self.isInitialized = () => _isInitialized;
@ -71,15 +76,9 @@ export class BaseCore implements IAppInsightsCore {
let extConfig = config.extensionConfig = _isNullOrUndefined(config.extensionConfig) ? {} : config.extensionConfig;
extConfig.NotificationManager = notificationManager;
if (!logger) {
logger = CoreUtils.objCreate({
throwInternal: (severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct = false) => { },
warnToConsole: (message: string) => { },
resetInternalMessageCount: () => { }
});
if (logger) {
_self.logger = logger;
}
_self.logger = logger;
// Concat all available extensions
let allExtensions = [];