From d7242f722a9d4a5fdeae0e09db0f6879c781d926 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Sat, 1 Sep 2018 12:28:15 +0200 Subject: [PATCH] exporting colors --- out/index.d.ts | 25 +++++++++++++++++++++ out/index.js | 58 +++++++++++++++++++++++++----------------------- out/index.js.map | 2 +- src/index.ts | 58 +++++++++++++++++++++++++----------------------- 4 files changed, 86 insertions(+), 57 deletions(-) diff --git a/out/index.d.ts b/out/index.d.ts index 60dc24a..943028b 100644 --- a/out/index.d.ts +++ b/out/index.d.ts @@ -1,5 +1,30 @@ /// import { EventEmitter } from "events"; +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; +}; export interface LoggingBaseOptions { logfile: string; errorfile: string; diff --git a/out/index.js b/out/index.js index d3cded3..8adad66 100644 --- a/out/index.js +++ b/out/index.js @@ -5,29 +5,31 @@ const fs = require("fs"); const events_1 = require("events"); const path = require("path"); const lock_1 = require("./lock"); -const Reset = "\x1b[0m"; -const Bright = "\x1b[1m"; -const Dim = "\x1b[2m"; -const Underscore = "\x1b[4m"; -const Blink = "\x1b[5m"; -const Reverse = "\x1b[7m"; -const Hidden = "\x1b[8m"; -const FgBlack = "\x1b[30m"; -const FgRed = "\x1b[31m"; -const FgGreen = "\x1b[32m"; -const FgYellow = "\x1b[33m"; -const FgBlue = "\x1b[34m"; -const FgMagenta = "\x1b[35m"; -const FgCyan = "\x1b[36m"; -const FgWhite = "\x1b[37m"; -const BgBlack = "\x1b[40m"; -const BgRed = "\x1b[41m"; -const BgGreen = "\x1b[42m"; -const BgYellow = "\x1b[43m"; -const BgBlue = "\x1b[44m"; -const BgMagenta = "\x1b[45m"; -const BgCyan = "\x1b[46m"; -const BgWhite = "\x1b[47m"; +exports.Colors = { + Reset: "\x1b[0m", + Bright: "\x1b[1m", + Dim: "\x1b[2m", + Underscore: "\x1b[4m", + Blink: "\x1b[5m", + Reverse: "\x1b[7m", + Hidden: "\x1b[8m", + FgBlack: "\x1b[30m", + FgRed: "\x1b[31m", + FgGreen: "\x1b[32m", + FgYellow: "\x1b[33m", + FgBlue: "\x1b[34m", + FgMagenta: "\x1b[35m", + FgCyan: "\x1b[36m", + FgWhite: "\x1b[37m", + BgBlack: "\x1b[40m", + BgRed: "\x1b[41m", + BgGreen: "\x1b[42m", + BgYellow: "\x1b[43m", + BgBlue: "\x1b[44m", + BgMagenta: "\x1b[45m", + BgCyan: "\x1b[46m", + BgWhite: "\x1b[47m" +}; const maxFileSize = 500000000; const OriginalErrorStackFunction = Error.prototype.prepareStackTrace; class LoggingBase { @@ -95,20 +97,20 @@ class LoggingBase { this.message(LoggingTypes.Error, message); } async message(type, message, customColors, caller) { - var consoleLogFormat = Reset; + var consoleLogFormat = exports.Colors.Reset; if (!customColors) { switch (type) { case LoggingTypes.Log: //m += FgWhite + BgBlack; break; case LoggingTypes.Error: - consoleLogFormat += FgRed; //FgWhite + BgRed + FgWhite; + consoleLogFormat += exports.Colors.FgRed; //FgWhite + BgRed + FgWhite; break; case LoggingTypes.Debug: - consoleLogFormat += FgCyan; + consoleLogFormat += exports.Colors.FgCyan; break; case LoggingTypes.Warning: - consoleLogFormat += FgYellow; + consoleLogFormat += exports.Colors.FgYellow; break; } } @@ -136,7 +138,7 @@ class LoggingBase { let prefix = `[${LoggingTypes[type]}][${file.file}:${file.line}][${date}]: `; let message_lines = mb.split("\n").map(line => prefix + line); if (this.config.console_out) - message_lines.forEach(line => console.log(consoleLogFormat + line + Reset)); + message_lines.forEach(line => console.log(consoleLogFormat + line + exports.Colors.Reset)); let m = message_lines.join("\n"); let index = m.indexOf("\x1b"); while (index >= 0) { diff --git a/out/index.js.map b/out/index.js.map index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AE;gBACf,OAAO;oBACJ,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;iBAC7B,CAAC;aACJ;SACH;KACH;AACJ,CAAC;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACrB,6CAAG,CAAA;IACH,qDAAO,CAAA;IACP,iDAAK,CAAA;IACL,iDAAK,CAAA;AACR,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,6BAA6B;AAC7B,yBAAyB;AACzB,mCAAsC;AACtC,6BAA6B;AAC7B,iCAA0B;AAEb,QAAA,MAAM,GAAG;IACnB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,SAAS;IACd,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IAEjB,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,UAAU;IACrB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,UAAU;IAEnB,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,UAAU;IACrB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,UAAU;CACrB,CAAA;AAED,MAAM,WAAW,GAAG,SAAS,CAAC;AAE9B,MAAM,0BAA0B,GAAS,KAAK,CAAC,SAAU,CAAC,iBAAiB,CAAA;AAQ3E;IAWG,YAAY,OAAqC;QATzC,cAAS,GAAG,IAAI,cAAI,EAAE,CAAC;QAIvB,aAAQ,GAAW,CAAC,CAAC;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,CAAC,CAAA;YACrC,IAAI,CAAC,IAAI,OAAO,EAAE;gBACf,OAAO;oBACJ,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;iBAC7B,CAAC;aACJ;SACH;KACH;AACJ,CAAC;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACrB,6CAAG,CAAA;IACH,qDAAO,CAAA;IACP,iDAAK,CAAA;IACL,iDAAK,CAAA;AACR,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB"} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 12948eb..31f1a78 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,31 +4,33 @@ import { EventEmitter } from "events"; import * as path from "path"; import Lock from "./lock"; -const Reset = "\x1b[0m" -const Bright = "\x1b[1m" -const Dim = "\x1b[2m" -const Underscore = "\x1b[4m" -const Blink = "\x1b[5m" -const Reverse = "\x1b[7m" -const Hidden = "\x1b[8m" +export const Colors = { + Reset: "\x1b[0m", + Bright: "\x1b[1m", + Dim: "\x1b[2m", + Underscore: "\x1b[4m", + Blink: "\x1b[5m", + Reverse: "\x1b[7m", + Hidden: "\x1b[8m", -const FgBlack = "\x1b[30m" -const FgRed = "\x1b[31m" -const FgGreen = "\x1b[32m" -const FgYellow = "\x1b[33m" -const FgBlue = "\x1b[34m" -const FgMagenta = "\x1b[35m" -const FgCyan = "\x1b[36m" -const FgWhite = "\x1b[37m" + FgBlack: "\x1b[30m", + FgRed: "\x1b[31m", + FgGreen: "\x1b[32m", + FgYellow: "\x1b[33m", + FgBlue: "\x1b[34m", + FgMagenta: "\x1b[35m", + FgCyan: "\x1b[36m", + FgWhite: "\x1b[37m", -const BgBlack = "\x1b[40m" -const BgRed = "\x1b[41m" -const BgGreen = "\x1b[42m" -const BgYellow = "\x1b[43m" -const BgBlue = "\x1b[44m" -const BgMagenta = "\x1b[45m" -const BgCyan = "\x1b[46m" -const BgWhite = "\x1b[47m" + BgBlack: "\x1b[40m", + BgRed: "\x1b[41m", + BgGreen: "\x1b[42m", + BgYellow: "\x1b[43m", + BgBlue: "\x1b[44m", + BgMagenta: "\x1b[45m", + BgCyan: "\x1b[46m", + BgWhite: "\x1b[47m" +} const maxFileSize = 500000000; @@ -122,20 +124,20 @@ export class LoggingBase { } private async message(type: LoggingTypes, message: any[] | string, customColors?: string, caller?: { file: string, line: number }) { - var consoleLogFormat = Reset; + var consoleLogFormat = Colors.Reset; if (!customColors) { switch (type) { case LoggingTypes.Log: //m += FgWhite + BgBlack; break; case LoggingTypes.Error: - consoleLogFormat += FgRed;//FgWhite + BgRed + FgWhite; + consoleLogFormat += Colors.FgRed;//FgWhite + BgRed + FgWhite; break; case LoggingTypes.Debug: - consoleLogFormat += FgCyan; + consoleLogFormat += Colors.FgCyan; break; case LoggingTypes.Warning: - consoleLogFormat += FgYellow; + consoleLogFormat += Colors.FgYellow; break; } } else { @@ -159,7 +161,7 @@ export class LoggingBase { let prefix = `[${LoggingTypes[type]}][${file.file}:${file.line}][${date}]: `; let message_lines = mb.split("\n").map(line => prefix + line); - if (this.config.console_out) message_lines.forEach(line => console.log(consoleLogFormat + line + Reset)); + if (this.config.console_out) message_lines.forEach(line => console.log(consoleLogFormat + line + Colors.Reset)); let m = message_lines.join("\n"); let index = m.indexOf("\x1b");