Skip to content

Commit

Permalink
fix: updating tests based on new DefaultLogger constructor signature
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Long <[email protected]>
  • Loading branch information
kevinmlong committed Dec 21, 2024
1 parent 587bf1a commit c4c4620
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/shared/src/hooks/logging-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export class LoggingHook implements BaseHook {
this.logger.error(payload);
}

finally(hookContext: Readonly<HookContext<FlagValue>>, hookHints?: HookHints): void {

finally(hookContext: Readonly<HookContext<FlagValue>>, evaluationDetails: EvaluationDetails<FlagValue>, hookHints?: HookHints): void {
this.logger.info(hookContext, hookHints);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/shared/test/logger-hook.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GeneralError } from '../src/errors';
import type { HookContext } from '../src/hooks/hooks';
import { LoggingHook } from '../src/hooks/logging-hook';
import { DefaultLogger, SafeLogger } from '../src/logger';
import { DefaultLogger, LOG_LEVELS, LogLevel, SafeLogger } from '../src/logger';

describe('LoggingHook', () => {
const FLAG_KEY = 'some-key';
Expand All @@ -21,7 +21,7 @@ describe('LoggingHook', () => {
const ERROR_MESSAGE_KEY = 'error_message';

let hookContext: HookContext;
const logger : SafeLogger = new SafeLogger(new DefaultLogger(true, true));
const logger : SafeLogger = new SafeLogger(new DefaultLogger(LogLevel.DEBUG));

beforeEach(() => {
const mockProviderMetaData = { name: PROVIDER_NAME };
Expand Down

0 comments on commit c4c4620

Please sign in to comment.