@rarible/logger
Advanced tools
Comparing version 0.10.0-alpha.6 to 0.10.0-alpha.8
export type LoggableValue = null | undefined | boolean | number | string | object; | ||
export type AbstractLogger = { | ||
raw(data: Record<string, any>): void; | ||
trace(...params: any[]): void; | ||
debug(...params: any[]): void; | ||
info(...params: any[]): void; | ||
warn(...params: any[]): void; | ||
error(...params: any[]): void; | ||
export type LoggableRawData = string | number; | ||
export type LoggableShape = { | ||
[K in string]: LoggableRawData; | ||
}; | ||
export interface AbstractLogger<C extends LoggableShape = LoggableShape> { | ||
getContext: () => Promise<C>; | ||
extend: <NewC extends LoggableShape>(next: NewC) => AbstractLogger<C & NewC>; | ||
raw: (data: LoggableShape) => void; | ||
trace: (...params: any[]) => void; | ||
debug: (...params: any[]) => void; | ||
info: (...params: any[]) => void; | ||
warn: (...params: any[]) => void; | ||
error: (...params: any[]) => void; | ||
} | ||
export declare enum LogLevel { | ||
@@ -11,0 +17,0 @@ DEBUG = "DEBUG", |
@@ -1,4 +0,5 @@ | ||
export * from "./remote"; | ||
export * from "./union"; | ||
export * from "./errors"; | ||
export * from "./utils/get-loggable-message"; | ||
export * from "./base"; | ||
export * from "./transports"; | ||
export * from "./domain"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./remote"), exports); | ||
tslib_1.__exportStar(require("./union"), exports); | ||
tslib_1.__exportStar(require("./errors"), exports); | ||
tslib_1.__exportStar(require("./utils/get-loggable-message"), exports); | ||
tslib_1.__exportStar(require("./base"), exports); | ||
tslib_1.__exportStar(require("./transports"), exports); | ||
tslib_1.__exportStar(require("./domain"), exports); |
@@ -5,4 +5,7 @@ "use strict"; | ||
function isError(value) { | ||
return Boolean(value && typeof value === "object" && "stack" in value); | ||
if (typeof value === "object" && value !== null && "stack" in value && "name" in value && "message" in value) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
exports.isError = isError; |
@@ -9,5 +9,5 @@ "use strict"; | ||
if ((0, is_error_1.isError)(x)) | ||
return `${x}`; | ||
return `${x.name}: ${x.message}`; | ||
return (0, json_stringify_safe_1.default)(x); | ||
} | ||
exports.toLoggableValue = toLoggableValue; |
{ | ||
"name": "@rarible/logger", | ||
"version": "0.10.0-alpha.6", | ||
"version": "0.10.0-alpha.8", | ||
"private": false, | ||
@@ -42,3 +42,3 @@ "description": "Logging utility for ts projects", | ||
}, | ||
"gitHead": "009ba3a898f3e85d6f84efdb9de3a3462b88d8d3" | ||
"gitHead": "2d19eebe20f9b34402aa6f98f1e6e3a0d0cbb2cd" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50615
32
524