Skip to content

Commit

Permalink
chore: fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
spence-s committed Sep 8, 2024
1 parent b155820 commit 44e5263
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Largely inspired from the great pino-colada project but with all the bells and w
- [Features](#features)
- [SAMPLES](#samples)
- [Gruvbox](#gruvbox)
- [Dracula](#dracula)
- [Goals](#goals)
- [Install](#install)
- [Usage](#usage)
Expand All @@ -30,12 +29,6 @@ Largely inspired from the great pino-colada project but with all the bells and w
#### Gruvbox

![Basic Formatting](./media/screenshot3.png)

![Error Formatting](./media//screenshot4.png)

#### Dracula

![Basic Formatting](./media/screenshot1.png)

![Error Formatting](./media/screenshot2.png)
Expand Down Expand Up @@ -147,7 +140,7 @@ module.exports = {
/**
* The color of boolean and null values
*/
literal: chalk.default
literal: chalk.default,
}),

/**
Expand All @@ -163,15 +156,15 @@ module.exports = {
formatDate: (date) => {},
formatName: (name) => {},
formatMessage: (message) => {},
formatBundleSize:(bundleSize) => {},
formatBundleSize: (bundleSize) => {},
formatNs: (ns) => {},
formatExtraFields: (extraFields) => {},
formatStack: (stack) => {},
formatUrl: (url) => {},
formatStatusCode: (statusCode) => {},
formatErrorProp: (err) => {},
formatMethod: (method) => {},
formatId: (id) => {}
}
formatId: (id) => {},
},
};
```
6 changes: 3 additions & 3 deletions lib/prettify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function formatLoadTime(elapsedTime: string | number): string {
}

export function formatTime(instant: string | number): string {
return chalk.gray(`[${format(new Date(instant), 'h:mm:ss:Sbbbbb')}]`);
return chalk.gray(`[${format(new Date(instant), 'h:mm:ss:SS aaa')}]`);
}

export function formatName(name: string): string {
Expand Down Expand Up @@ -234,8 +234,8 @@ export function prettify({
msg: formatMessage,
responseTime: formatLoadTime,
extraFields: formatExtraFields,
err: formatErrorProp,
'err.stack': formatStack,
[errorKey]: formatErrorProp,
[`${errorKey}.stack`]: formatStack,
...format,
};

Expand Down
Binary file modified media/screenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed media/screenshot3.png
Binary file not shown.
Binary file removed media/screenshot4.png
Binary file not shown.
3 changes: 3 additions & 0 deletions scripts/create-sample-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const createLogLine = (level, ns, extra, msg, status = true) =>
level,
name: 'HTTP',
msg: msg ?? `This is a ${ns} message`,
time: new Date(),
req: {
method: 'POST',
url: `/api/${ns}`,
Expand Down Expand Up @@ -114,6 +115,7 @@ console.log();
console.log(
prettify({
level: 50,
time: new Date(),
err: {
type: 'Error',
message: 'example error',
Expand All @@ -132,6 +134,7 @@ const aggErr2 = new Error('throw em all the time!');
console.log(
prettify({
level: 60,
time: new Date(),
msg: 'What about aggregate errors??',
err: {
message: 'the primary aggregate error',
Expand Down

0 comments on commit 44e5263

Please sign in to comment.