@infinite-fansub/logger
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -11,3 +11,8 @@ import { Color, Colour, DirectGradient, JoinedGradient } from "colours.js"; | ||
error(log: string | TemplateStringsArray, ...values: Array<string>): void; | ||
print(log: string, customColor: Color | Colour | DirectGradient | JoinedGradient): void; | ||
printf(log: string, customColor: Color | Colour | DirectGradient | JoinedGradient): void; | ||
print(log: string, options?: { | ||
memory?: boolean; | ||
date?: boolean; | ||
emoji?: boolean; | ||
} | boolean): void; | ||
resetColors(): void; | ||
@@ -14,0 +19,0 @@ get showDay(): boolean; |
@@ -78,9 +78,22 @@ "use strict"; | ||
} | ||
print(log, customColor) { | ||
printf(log, customColor) { | ||
log = `${this.date()} ${this.#emoji} ${customColor instanceof colours_js_1.Color || customColor instanceof colours_js_1.Colour ? uniform(log, customColor) : gradient(log, customColor)}`; | ||
if (this.#showMemory) | ||
console.error(this.addMemoryToString(log)); | ||
console.log(this.addMemoryToString(log)); | ||
else | ||
console.error(log); | ||
console.log(log); | ||
} | ||
print(log, options) { | ||
if (typeof options === "boolean") | ||
log = this.addMemoryToString(`${this.date()} ${this.#emoji} ${log}`); | ||
else { | ||
if (options?.emoji) | ||
log = `${this.#emoji} ${log}`; | ||
if (options?.date) | ||
log = `${this.date()} ${log}`; | ||
if (options?.memory) | ||
log = this.addMemoryToString(log); | ||
} | ||
console.log(log); | ||
} | ||
resetColors() { | ||
@@ -87,0 +100,0 @@ this.#colors = { ...this.#defaultColors }; |
{ | ||
"name": "@infinite-fansub/logger", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"description": "Infinite logger", | ||
@@ -13,4 +13,4 @@ "author": "Infinite", | ||
"eslint:fix": "eslint --fix", | ||
"build": "tsc", | ||
"build:watch": "tsc --watch", | ||
"build": "rm -rf dist && tsc", | ||
"build:watch": "rm -rf dist && tsc --watch", | ||
"build:test": "tsc --noEmit", | ||
@@ -17,0 +17,0 @@ "node": "node .", |
Sorry, the diff of this file is not supported yet
27468
470