Skip to content

Commit

Permalink
fix(common): remove platform-log-middleware import in source code
Browse files Browse the repository at this point in the history
BREAKING CHANGE: you have to import explicitly @tsed/platform-log-middleware as middleware in the server configuration.
  • Loading branch information
Romakita committed Oct 2, 2024
1 parent c74e252 commit 6372319
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions packages/platform/common/src/builder/PlatformBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,6 @@ export class PlatformBuilder<App = TsED.Application> {
this.log("Load routes");
await this.#adapter.beforeLoadRoutes();

// istanbul ignore next
if (this.settings.get("logger.level") !== "off") {
const {PlatformLogMiddleware} = await import("@tsed/platform-log-middleware");
this.app.use(PlatformLogMiddleware);
}

if (this.rootModule.$beforeRoutesInit) {
await this.rootModule.$beforeRoutesInit();
// remove method to avoid multiple call and preserve hook order
Expand Down
1 change: 0 additions & 1 deletion packages/platform/common/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "@tsed/logger-file";
export * from "@tsed/di";
export {$log, Logger} from "@tsed/logger";
export * from "@tsed/platform-exceptions";
export * from "@tsed/platform-log-middleware";
export * from "@tsed/platform-middlewares";
export * from "@tsed/platform-params";
export * from "@tsed/platform-response-filter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class PlatformLogMiddleware implements MiddlewareMethods {
case "info":
return {...this.minimalRequestPicker(ctx), ...obj};
case "debug":
return withRequest ? {...this.requestToObject(ctx), ...obj} : obj;
return {...this.requestToObject(ctx), ...obj};
default:
return {...this.requestToObject(ctx), ...obj};
}
Expand Down

0 comments on commit 6372319

Please sign in to comment.