From 7e8f6e1b545e29fa73f98104d39703e19bc19d92 Mon Sep 17 00:00:00 2001 From: Shirtiny <49592759+Shirtiny@users.noreply.github.com> Date: Sun, 29 Jan 2023 05:38:29 +0000 Subject: [PATCH] custom format --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 866901c..c5db138 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ customLogger.custom("custom message", { data: "any data" }); import { Logger, css } from "@shirtiny/logger"; class FullCustomerLogger extends Logger { - custom = (message: string, ...data: any[]) => { + custom2 = (message: string, ...data: any[]) => { const level = 4; this.formatLog( level, @@ -193,6 +193,34 @@ class FullCustomerLogger extends Logger { ...data, ); }; + + custom3 = (message: string, ...data: any[]) => { + const level = 4; + this.customFormat( + level, + [ + { + str: " Custom ", + style: css` + color: #fff; + padding: 2px; + background-color: #3f6600; + border-radius: 3px; + margin-right: 8px; + `, + }, + { + str: message, + style: css` + color: #3f6600; + font-size: 15px; + font-family: "Trebuchet MS"; + `, + } + ] + ...data, + ); + }; } const customerLogger = new FullCustomerLogger();