@bogeychan/elysia-logger
Advanced tools
Comparing version 0.1.6 to 0.1.7
import { pino } from "pino"; | ||
import { Elysia } from "elysia"; | ||
import type { ElysiaLogger, StandaloneLoggerOptions, ElysiaFileLoggerOptions, ElysiaStreamLoggerOptions, _INTERNAL_Writeonly, _INTERNAL_ElysiaLoggerPlugin, _INTERNAL_ElysiaLoggerPluginAutoLoggingState, _INTERNAL_ElysiaLoggerPluginAutoLoggingEnabledOptions, _INTERNAL_ElysiaLoggerPluginAutoLoggingDisabledOptions } from "./types.js"; | ||
import type { Logger, ElysiaLogger, StandaloneLoggerOptions, ElysiaFileLoggerOptions, ElysiaStreamLoggerOptions, _INTERNAL_Writeonly, _INTERNAL_ElysiaLoggerPlugin, _INTERNAL_ElysiaLoggerPluginAutoLoggingState, _INTERNAL_ElysiaLoggerPluginAutoLoggingEnabledOptions, _INTERNAL_ElysiaLoggerPluginAutoLoggingDisabledOptions } from "./types.js"; | ||
/** | ||
@@ -17,11 +17,11 @@ * The StreamLogger is used to write log entries to a stream such as the console output (default behavior). | ||
*/ | ||
export declare function createPinoLogger(options?: StandaloneLoggerOptions): ElysiaLogger<Elysia<"", false, { | ||
export declare function createPinoLogger(options?: StandaloneLoggerOptions): ElysiaLogger<Elysia<"", { | ||
decorator: {}; | ||
store: {}; | ||
derive: {}; | ||
resolve: { | ||
derive: { | ||
readonly log: pino.Logger<never, boolean>; | ||
}; | ||
resolve: {}; | ||
}, { | ||
type: {}; | ||
typebox: import("@sinclair/typebox").TModule<{}>; | ||
error: {}; | ||
@@ -32,2 +32,3 @@ }, { | ||
macroFn: {}; | ||
parser: {}; | ||
}, {}, { | ||
@@ -41,5 +42,28 @@ derive: {}; | ||
schema: {}; | ||
}> | _INTERNAL_ElysiaLoggerPlugin<_INTERNAL_Writeonly<_INTERNAL_ElysiaLoggerPluginAutoLoggingState>>>; | ||
}> | Elysia<"", { | ||
decorator: {}; | ||
store: _INTERNAL_Writeonly<_INTERNAL_ElysiaLoggerPluginAutoLoggingState>; | ||
derive: { | ||
readonly log: Logger; | ||
}; | ||
resolve: {}; | ||
}, { | ||
typebox: import("@sinclair/typebox").TModule<{}>; | ||
error: {}; | ||
}, { | ||
schema: import("elysia").MergeSchema<import("elysia").MergeSchema<{}, {}, "">, {}, "">; | ||
macro: {}; | ||
macroFn: {}; | ||
parser: {}; | ||
}, {}, { | ||
derive: {}; | ||
resolve: {}; | ||
schema: {}; | ||
}, { | ||
derive: {}; | ||
resolve: {}; | ||
schema: {}; | ||
}>>; | ||
export * from "./config/index.js"; | ||
export type { InferContext } from "./types.js"; | ||
export { pino } from "pino"; |
@@ -60,3 +60,3 @@ import { pino } from "pino"; | ||
}) | ||
.onAfterResponse({ as: "global" }, (ctx) => { | ||
.onAfterResponse((ctx) => { | ||
const loggerCtx = ctx; | ||
@@ -76,3 +76,3 @@ loggerCtx.isError = false; | ||
}) | ||
.onError({ as: "global" }, (ctx) => { | ||
.onError((ctx) => { | ||
const loggerCtx = ctx; | ||
@@ -93,3 +93,4 @@ loggerCtx.isError = true; | ||
} | ||
}); | ||
}) | ||
.as("global"); | ||
} | ||
@@ -96,0 +97,0 @@ return app; |
@@ -72,3 +72,3 @@ import type { pino } from "pino"; | ||
export type Logger = pino.Logger & BaseLoggerOptions; | ||
export type InferContext<T> = T extends Elysia<infer _Path, infer _Scoped, infer Singleton, infer Definitions, infer _Metadata, infer _Routes, infer Ephemeral, infer Volatile> ? ({ | ||
export type InferContext<T> = T extends Elysia<infer _Path, infer Singleton, infer Definitions, infer _Metadata, infer _Routes, infer Ephemeral, infer Volatile> ? ({ | ||
isError: false; | ||
@@ -101,3 +101,3 @@ } & Context<RouteSchema, { | ||
}; | ||
export type _INTERNAL_ElysiaLoggerPlugin<Store extends Elysia["store"] = Elysia["store"]> = Elysia<"", false, { | ||
export type _INTERNAL_ElysiaLoggerPlugin<Store extends Elysia["store"] = Elysia["store"]> = Elysia<"", { | ||
store: Store; | ||
@@ -104,0 +104,0 @@ derive: { |
{ | ||
"name": "@bogeychan/elysia-logger", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "A plugin for Elysia.js for logging using the pino library", | ||
@@ -37,7 +37,7 @@ "author": { | ||
"peerDependencies": { | ||
"elysia": ">= 1.1.0" | ||
"elysia": ">= 1.2.2" | ||
}, | ||
"devDependencies": { | ||
"@types/bun": "^1.1.14", | ||
"elysia": "1.1.0", | ||
"elysia": "1.2.2", | ||
"pino-pretty": "^13.0.0", | ||
@@ -48,3 +48,3 @@ "tsd": "^0.31.2", | ||
"dependencies": { | ||
"pino": "^9.5.0" | ||
"pino": "^9.6.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "homepage": "https://github.com/bogeychan/elysia-logger", |
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
18966
384
Updatedpino@^9.6.0