Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/http",
"version": "5.31.0",
"version": "5.32.0",
"description": "The Athenna Http server. Built on top of fastify.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
28 changes: 6 additions & 22 deletions src/kernels/HttpKernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,10 @@ export class HttpKernel {
/**
* Register the cls-rtracer plugin in the Http server.
*/
public async registerRTracer(trace?: boolean): Promise<void> {
public async registerRTracer(): Promise<void> {
const rTracerPlugin = await Module.safeImport('cls-rtracer')

if (trace === false) {
debug(
'Not able to register rTracer plugin. Set the trace option as true in your http server options.'
)

return
}

if (trace === undefined && Config.is('http.rTracer.enabled', false)) {
if (Config.is('http.rTracer.enabled', false)) {
debug(
'Not able to register rTracer plugin. Set the http.rTracer.enabled configuration as true.'
)
Expand All @@ -212,18 +204,10 @@ export class HttpKernel {
/**
* Register the @athenna/vite plugin in the Http server.
*/
public async registerVite(trace?: boolean): Promise<void> {
public async registerVite(): Promise<void> {
const vitePlugin = await Module.safeImport('@athenna/vite/plugins/fastify')

if (trace === false) {
debug(
'Not able to register vite plugin. Set the trace option as true in your http server options.'
)

return
}

if (trace === undefined && Config.is('http.vite.enabled', false)) {
if (Config.is('http.vite.enabled', false)) {
debug(
'Not able to register vite plugin. Set the http.vite.enabled configuration as true.'
)
Expand Down Expand Up @@ -281,11 +265,11 @@ export class HttpKernel {

Server.terminate(ctx => {
if (!isToLogRequest) {
return Log.channelOrVanilla(channel).info(ctx)
return Log.channelOrVanilla(channel || 'request').info(ctx)
}

if (isToLogRequest(ctx)) {
return Log.channelOrVanilla(channel).info(ctx)
return Log.channelOrVanilla(channel || 'request').info(ctx)
}
})
}
Expand Down
Loading