Skip to content

Commit

Permalink
custom format
Browse files Browse the repository at this point in the history
  • Loading branch information
Shirtiny committed Jan 29, 2023
1 parent f8528e2 commit 7e8f6e1
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
Expand Down

0 comments on commit 7e8f6e1

Please sign in to comment.