Skip to content

Commit

Permalink
feat(logging): Added WireIt scripts to the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Jan 1, 2024
1 parent cf29f80 commit 658bada
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 26 deletions.
92 changes: 81 additions & 11 deletions docs/api-reports/packages/errors/documents-model.api.json
Expand Up @@ -204,7 +204,7 @@
},
{
"kind": "Content",
"text": " & {\n code: TCode;\n}"
"text": " & {\n code?: TCode;\n}"
},
{
"kind": "Content",
Expand All @@ -224,7 +224,7 @@
"text": ";"
}
],
"fileUrlPath": "packages/errors/src/storm-error.ts",
"fileUrlPath": "packages/errors/src/utilities/create-storm-error.ts",
"returnTypeTokenRange": {
"startIndex": 8,
"endIndex": 10
Expand Down Expand Up @@ -532,7 +532,7 @@
"text": ";"
}
],
"fileUrlPath": "packages/errors/src/storm-error.ts",
"fileUrlPath": "packages/errors/src/utilities/get-cause-from-unknown.ts",
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
Expand Down Expand Up @@ -827,7 +827,7 @@
"excerptTokens": [
{
"kind": "Content",
"text": "cause?: "
"text": "get cause(): "
},
{
"kind": "Reference",
Expand All @@ -836,16 +836,20 @@
},
{
"kind": "Content",
"text": ";"
"text": " | undefined"
},
{
"kind": "Content",
"text": ";\n\nset cause(_cause: unknown);"
}
],
"isReadonly": false,
"isOptional": true,
"isOptional": false,
"releaseTag": "Public",
"name": "cause",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
"endIndex": 3
},
"isStatic": false,
"isProtected": false,
Expand Down Expand Up @@ -881,6 +885,55 @@
"isProtected": false,
"isAbstract": false
},
{
"kind": "Method",
"canonicalReference": "@storm-stack/errors!StormError.create:member(1)",
"docComment": "/**\n * Creates a new StormError instance\n *\n * @param error - The error to create\n *\n * @returns The newly created StormError\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "static create(error?: "
},
{
"kind": "Content",
"text": "unknown"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "StormError",
"canonicalReference": "@storm-stack/errors!StormError:class"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": true,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"isProtected": false,
"overloadIndex": 1,
"parameters": [
{
"parameterName": "error",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": true
}
],
"isOptional": false,
"isAbstract": false,
"name": "create"
},
{
"kind": "Property",
"canonicalReference": "@storm-stack/errors!StormError#data:member",
Expand Down Expand Up @@ -1009,7 +1062,15 @@
"excerptTokens": [
{
"kind": "Content",
"text": "toString(): "
"text": "toString(stacktrace?: "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
Expand All @@ -1022,13 +1083,22 @@
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"isProtected": false,
"overloadIndex": 1,
"parameters": [],
"parameters": [
{
"parameterName": "stacktrace",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isOptional": true
}
],
"isOptional": false,
"isAbstract": false,
"name": "toString"
Expand Down
17 changes: 15 additions & 2 deletions package.json
Expand Up @@ -132,7 +132,8 @@
"ts-node": "10.9.2",
"tslib": "2.6.2",
"typescript": "5.3.3",
"verdaccio": "5.29.0"
"verdaccio": "5.29.0",
"wireit": "^0.14.1"
},
"peerDependencies": {
"husky": "8.0.3"
Expand Down Expand Up @@ -164,5 +165,17 @@
"@storm-stack/docs-website": "workspace:*"
}
},
"triggerEmptyDevReleaseByIncrementingThisNumber": 0
"triggerEmptyDevReleaseByIncrementingThisNumber": 0,
"wireit": {
"build": {
"command": "nx affected -t build --parallel=5",
"dependencies": [
"clean",
"build:tools"
]
},
"clean": {
"command": "rimraf dist"
}
}
}
15 changes: 2 additions & 13 deletions packages/logging/src/utilities/pino-logger.ts
Expand Up @@ -102,22 +102,11 @@ export const getPinoLogger = (
"[{time}] {levelLabel} ({if pid}{pid} - {end}{req.url}: {msg}",
singleLine: false,
hideObject: false,
customColors: {}
customColors: ""
};

if (config.colors) {
prettyOptions.customColors = {
exception: config.colors.error,
err: config.colors.error,
error: config.colors.error,
fatal: config.colors.fatal,
warn: config.colors.warning,
info: config.colors.info,
debug: config.colors.primary,
trace: config.colors.primary,
"req.url": config.colors.primary,
success: config.colors.success
};
prettyOptions.customColors = `exception:${config.colors.error},err:${config.colors.error},error:${config.colors.error},fatal:${config.colors.fatal},warn:${config.colors.warning},info:${config.colors.info},debug:${config.colors.primary},trace:${config.colors.primary},req.url:${config.colors.primary},success:${config.colors.success}`;
}

let streams: Array<pino.DestinationStream | pino.StreamEntry<pino.Level>> = [
Expand Down
37 changes: 37 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 658bada

Please sign in to comment.