2017-09-16 17:12:58 +00:00
|
|
|
/// <reference types="node" />
|
|
|
|
import { EventEmitter } from "events";
|
2018-09-01 10:28:15 +00:00
|
|
|
export declare const Colors: {
|
|
|
|
Reset: string;
|
|
|
|
Bright: string;
|
|
|
|
Dim: string;
|
|
|
|
Underscore: string;
|
|
|
|
Blink: string;
|
|
|
|
Reverse: string;
|
|
|
|
Hidden: string;
|
|
|
|
FgBlack: string;
|
|
|
|
FgRed: string;
|
|
|
|
FgGreen: string;
|
|
|
|
FgYellow: string;
|
|
|
|
FgBlue: string;
|
|
|
|
FgMagenta: string;
|
|
|
|
FgCyan: string;
|
|
|
|
FgWhite: string;
|
|
|
|
BgBlack: string;
|
|
|
|
BgRed: string;
|
|
|
|
BgGreen: string;
|
|
|
|
BgYellow: string;
|
|
|
|
BgBlue: string;
|
|
|
|
BgMagenta: string;
|
|
|
|
BgCyan: string;
|
|
|
|
BgWhite: string;
|
|
|
|
};
|
2018-08-09 17:52:01 +00:00
|
|
|
export interface LoggingBaseOptions {
|
2018-09-01 14:45:22 +00:00
|
|
|
/**
|
2018-09-20 16:30:21 +00:00
|
|
|
* Name will be prefixed on Console output and added to logfiles, if not specified here
|
2018-09-01 14:45:22 +00:00
|
|
|
*/
|
|
|
|
name: string;
|
2018-09-20 16:30:21 +00:00
|
|
|
/**
|
|
|
|
* Filename/path of the logfile. Skip if generated with name
|
|
|
|
*/
|
2018-08-09 17:52:01 +00:00
|
|
|
logfile: string;
|
2018-09-20 16:30:21 +00:00
|
|
|
/**
|
|
|
|
* Filename/path of the logfile. Skip if generated with name
|
|
|
|
*/
|
2018-08-09 17:52:01 +00:00
|
|
|
errorfile: string;
|
2018-09-20 16:30:21 +00:00
|
|
|
/**
|
|
|
|
* Prints output to console
|
|
|
|
*/
|
2018-08-09 17:52:01 +00:00
|
|
|
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;
|
2018-09-28 08:05:10 +00:00
|
|
|
private setted_up;
|
2018-08-09 17:52:01 +00:00
|
|
|
private fileStream;
|
|
|
|
private errorStream;
|
|
|
|
private fileSize;
|
|
|
|
private errorSize;
|
|
|
|
private queue;
|
2018-09-28 10:37:13 +00:00
|
|
|
constructor(options?: Partial<LoggingBaseOptions> | string);
|
2018-08-09 17:52:01 +00:00
|
|
|
console_out: boolean;
|
|
|
|
waitForSetup(): Promise<void>;
|
2018-09-28 08:05:10 +00:00
|
|
|
private setup;
|
2018-08-09 17:52:01 +00:00
|
|
|
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;
|
2018-09-28 08:05:10 +00:00
|
|
|
private message;
|
|
|
|
private writeMessageToFile;
|
|
|
|
private checkQueue;
|
|
|
|
private writeToLogFile;
|
|
|
|
private writeToErrorFile;
|
|
|
|
private initializeFile;
|
2018-08-09 17:52:01 +00:00
|
|
|
}
|
2018-09-28 10:03:48 +00:00
|
|
|
export declare let 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,
|
2018-09-28 08:05:10 +00:00
|
|
|
Debug = 3
|
2017-08-23 14:45:03 +00:00
|
|
|
}
|