Skip to content

Commit

Permalink
fix(logging): Resolved issue with empty config values
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Dec 29, 2023
1 parent 8c3acb0 commit 1b8e905
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
3 changes: 1 addition & 2 deletions docs/api-reports/packages/logging/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { DestinationStream } from "pino";
import { Logger } from "pino";
import { LoggerOptions as LoggerOptions_2 } from "pino";
import pretty from "pino-pretty";
import { StormConfig } from "@storm-software/config-tools";
import { Temporal } from "@js-temporal/polyfill";
import * as z from "zod";
Expand All @@ -21,7 +20,7 @@ export const getLogLevelLabel: (logLevel: number) => LogLevelLabel;
const getTransports: (
config: StormConfig<"logging", LoggingConfig>,
name?: string
) => Logger<pretty.PrettyStream>;
) => Logger<any>;
export { getTransports };
export { getTransports as getTransports_alias_1 };
export { getTransports as getTransports_alias_2 };
Expand Down
13 changes: 2 additions & 11 deletions docs/api-reports/packages/logging/documents-model.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,7 @@
},
{
"kind": "Content",
"text": ">, name?: string) => import(\"pino\").Logger<"
},
{
"kind": "Reference",
"text": "pretty.PrettyStream",
"canonicalReference": "!pretty.PrettyStream:type"
},
{
"kind": "Content",
"text": ">"
"text": ">, name?: string) => import(\"pino\").Logger<any>"
}
],
"fileUrlPath": "packages/logging/src/utilities/get-transports.ts",
Expand All @@ -275,7 +266,7 @@
"name": "getTransports",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 8
"endIndex": 6
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/logging/src/composition/logger-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class LoggerWrapper implements ILoggerWrapper {
private constructor(logger: ILogger, config: LoggingConfig, name?: string) {
this.#logger = logger;
this.#name = name;
this.#config = config;
this.#config = config ?? { stacktrace: true };
}

/**
Expand Down
17 changes: 13 additions & 4 deletions packages/logging/src/utilities/get-transports.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { StormConfig } from "@storm-software/config-tools";
import { isSetString } from "@storm-stack/utilities";
import {
StormDateTime,
formatDate,
formatDateTime
} from "@storm-stack/date-time";
import {
EMPTY_STRING,
isRuntimeServer,
isSetString
} from "@storm-stack/utilities";
import { tmpdir } from "os";
import { join } from "path";
import pino, {
Expand Down Expand Up @@ -102,7 +111,7 @@ export const getTransports = (
};
}

/* if (isRuntimeServer()) {
if (isRuntimeServer()) {
const pinoServerOptions = {
options: {
...baseOptions,
Expand All @@ -128,7 +137,7 @@ Message: {msg}
}
};

targets.push(
targets.push(
...[
{
target: "pino/file",
Expand Down Expand Up @@ -228,7 +237,7 @@ Message: {msg}
targets
}),
pretty(prettyOptions)
);*/
);

return pino(pretty());
};

0 comments on commit 1b8e905

Please sign in to comment.