@push.rocks/smartlog
Version:
A minimalistic, distributed, and extensible logging tool supporting centralized log management.
35 lines (34 loc) • 1.69 kB
TypeScript
import * as plugins from './smartlog.plugins.js';
import { LogGroup } from './smartlog.classes.loggroup.js';
export interface ISmartlogContructorOptions {
logContext: plugins.smartlogInterfaces.ILogContext;
minimumLogLevel?: plugins.smartlogInterfaces.TLogLevel;
}
export declare class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
static createForCommitinfo(commitinfo: plugins.smartlogInterfaces.ILogContext['commitinfo']): Smartlog;
logContext: plugins.smartlogInterfaces.ILogContext;
minimumLogLevel: plugins.smartlogInterfaces.TLogLevel;
uniInstanceId: string;
private consoleEnabled;
private logRouter;
addLogDestination(logDestinationArg: plugins.smartlogInterfaces.ILogDestination): void;
constructor(optionsArg: ISmartlogContructorOptions);
/**
* enables console logging
*/
enableConsole(optionsArg?: {
captureAll: boolean;
}): void;
/**
* main log method
* @param logLevelArg - the log level
* @param logMessageArg - the log message
* @param logDataArg - any additional log data
* @param correlationArg - info about corrleations
*/
log(logLevelArg: plugins.smartlogInterfaces.TLogLevel, logMessageArg: string, logDataArg?: any, correlationArg?: plugins.smartlogInterfaces.ILogCorrelation): Promise<void>;
increment(logLevelArg: plugins.smartlogInterfaces.TLogLevel, logMessageArg: string, logDataArg?: any, correlationArg?: plugins.smartlogInterfaces.ILogCorrelation): void;
handleLog(logPackageArg: plugins.smartlogInterfaces.ILogPackage): Promise<void>;
private safeConsoleLog;
createLogGroup(transactionId?: string): LogGroup;
}