2017-09-16 17:12:58 +00:00
|
|
|
/// <reference types="node" />
|
|
|
|
import { EventEmitter } from "events";
|
2018-08-09 17:52:01 +00:00
|
|
|
export interface LoggingBaseOptions {
|
|
|
|
logfile: string;
|
|
|
|
errorfile: string;
|
|
|
|
console_out: boolean;
|
2017-08-23 14:45:03 +00:00
|
|
|
}
|
2018-08-09 17:52:01 +00:00
|
|
|
export declare class LoggingBase {
|
|
|
|
private config;
|
|
|
|
private writeLock;
|
|
|
|
private fileStream;
|
|
|
|
private errorStream;
|
|
|
|
private fileSize;
|
|
|
|
private errorSize;
|
|
|
|
private queue;
|
|
|
|
constructor(options?: Partial<LoggingBaseOptions>);
|
|
|
|
console_out: boolean;
|
|
|
|
waitForSetup(): Promise<void>;
|
|
|
|
private setup();
|
|
|
|
events: EventEmitter;
|
|
|
|
debug(...message: any[]): void;
|
|
|
|
log(...message: any[]): void;
|
|
|
|
warning(...message: any[]): void;
|
|
|
|
logWithCustomColors(type: LoggingTypes, colors: string, ...message: any[]): void;
|
|
|
|
error(error: Error | string): void;
|
|
|
|
errorMessage(...message: any[]): void;
|
|
|
|
private message(type, message, customColors?);
|
|
|
|
private writeMessageToFile(message, error?);
|
|
|
|
private checkQueue();
|
|
|
|
private writeToLogFile(data);
|
|
|
|
private writeToErrorFile(data);
|
|
|
|
private initializeFile(file, new_file?);
|
|
|
|
}
|
|
|
|
export declare const Logging: LoggingBase;
|
2018-05-12 16:46:47 +00:00
|
|
|
export default Logging;
|
2017-08-23 14:45:03 +00:00
|
|
|
export declare enum LoggingTypes {
|
|
|
|
Log = 0,
|
|
|
|
Warning = 1,
|
|
|
|
Error = 2,
|
|
|
|
Debug = 3,
|
|
|
|
}
|