Skip to content

Commit

Permalink
fix: service now returns service instance when changing the log level
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed Oct 1, 2023
1 parent 25ea602 commit 99b3be9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-pumpkins-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ogma/nestjs-module': patch
---

OgmaService properly returns the OgmaService instance when changing the log level, insterad of the underkying Ogma class instance
7 changes: 4 additions & 3 deletions packages/nestjs-module/src/ogma.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export class OgmaService implements LoggerService {
* @param the new log level to use
*/
public setLogLevel(level: keyof typeof LogLevel) {
return this.ogma.setLogLevel(level);
this.ogma.setLogLevel(level);
return this;
}

/**
Expand All @@ -67,7 +68,7 @@ export class OgmaService implements LoggerService {
* use Ogma to log at the ERROR level. You can provide a stack trace as well.
* @param message What to print to the Ogma instance
* @param meta additional information you can print about the log OR the stack trace to print
* @param context a string for the context in which the error log was called. This can be provided as a part of the meta, or as a third paramter to stay in line with Nest's LoggerService
* @param context a string for the context in which the error log was called. This can be provided as a part of the meta, or as a third parameter to stay in line with Nest's LoggerService
*/
public error(
message: any,
Expand Down Expand Up @@ -103,7 +104,7 @@ export class OgmaService implements LoggerService {
}

/**
* use Ogma to log at the DBEUG level
* use Ogma to log at the DEBUG level
* @param message What to print to the Ogma instance
* @param meta extra metadata for the log
*/
Expand Down

0 comments on commit 99b3be9

Please sign in to comment.