@azure/functions
Version:
Microsoft Azure Functions NodeJS Framework
18 lines (15 loc) • 648 B
text/typescript
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.
import * as types from '@azure/functions';
import { format } from 'util';
import { fallbackLogHandler } from './fallbackLogHandler';
import { tryGetCoreApiLazy } from './tryGetCoreApiLazy';
export function workerSystemLog(level: types.LogLevel, ...args: unknown[]): void {
const coreApi = tryGetCoreApiLazy();
// NOTE: coreApi.log doesn't exist on older versions of the worker
if (coreApi && coreApi.log) {
coreApi.log(level, 'system', format(...args));
} else {
fallbackLogHandler(level, ...args);
}
}