1
0
mirror of https://git.stamm.me/OpenServer/NodeLogging.git synced 2024-11-14 23:01:04 +00:00

adding builded files

This commit is contained in:
Fabian Stamm 2017-09-16 19:22:02 +02:00
parent feae07bcb0
commit e950da73f9
3 changed files with 25 additions and 16 deletions

3
out/index.d.ts vendored
View File

@ -12,9 +12,10 @@ export declare class Logging {
static debug(...message: any[]): void;
static log(...message: any[]): void;
static warning(...message: any[]): void;
static logWithCustomColors(type: LoggingTypes, colors: string, ...message: any[]): void;
static error(error: Error | string): void;
static errorMessage(...message: string[]): void;
private static message(type, message);
private static message(type, message, customColors?);
private static writeMessageToFile(message, error?);
private static checkQueue();
private static initializeFile();

View File

@ -40,6 +40,9 @@ class Logging {
static warning(...message) {
Logging.message(LoggingTypes.Log, message);
}
static logWithCustomColors(type, colors, ...message) {
Logging.message(type, message, colors);
}
static error(error) {
if (typeof error === "string") {
Logging.errorMessage(error);
@ -55,21 +58,26 @@ class Logging {
static errorMessage(...message) {
Logging.message(LoggingTypes.Error, message);
}
static async message(type, message) {
static async message(type, message, customColors) {
var consoleLogFormat = Reset;
switch (type) {
case LoggingTypes.Log:
//m += FgWhite + BgBlack;
break;
case LoggingTypes.Error:
consoleLogFormat += FgRed; //FgWhite + BgRed + FgWhite;
break;
case LoggingTypes.Debug:
consoleLogFormat += FgCyan;
break;
case LoggingTypes.Warning:
consoleLogFormat += FgYellow;
break;
if (!customColors) {
switch (type) {
case LoggingTypes.Log:
//m += FgWhite + BgBlack;
break;
case LoggingTypes.Error:
consoleLogFormat += FgRed; //FgWhite + BgRed + FgWhite;
break;
case LoggingTypes.Debug:
consoleLogFormat += FgCyan;
break;
case LoggingTypes.Warning:
consoleLogFormat += FgYellow;
break;
}
}
else {
consoleLogFormat += customColors;
}
var mb = "";
if (typeof message === "string") {

File diff suppressed because one or more lines are too long