aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/logger/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/logger/utils.ts')
-rw-r--r--lib/logger/utils.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/logger/utils.ts b/lib/logger/utils.ts
index 5b2d512601a..b85f2c44de2 100644
--- a/lib/logger/utils.ts
+++ b/lib/logger/utils.ts
@@ -339,3 +339,16 @@ export function getEnv(key: string): string | undefined {
.map((v) => v?.toLowerCase().trim())
.find(is.nonEmptyStringAndNotWhitespace);
}
+
+export function getMessage(
+ p1: string | Record<string, any>,
+ p2?: string,
+): string | undefined {
+ return is.string(p1) ? p1 : p2;
+}
+
+export function toMeta(
+ p1: string | Record<string, any>,
+): Record<string, unknown> {
+ return is.object(p1) ? p1 : {};
+}