fix logger

This commit is contained in:
2025-12-15 22:39:17 +01:00
parent 7a11daa878
commit 3b566c973d
110 changed files with 1413 additions and 903 deletions

View File

@@ -1,4 +1,4 @@
export interface ILogger {
export interface Logger {
debug(message: string, context?: Record<string, any>): void;
info(message: string, context?: Record<string, any>): void;
warn(message: string, context?: Record<string, any>): void;

View File

@@ -1,11 +1,11 @@
import type { LogLevel } from './LoggerLogLevel';
import type { LogContext } from './LoggerContext';
import type { ILogger } from '@gridpilot/shared/logging/ILogger';
import type { Logger } from '@gridpilot/shared/logging/Logger';
/**
* LoggerPort - Port interface for application-layer logging.
*/
export interface LoggerPort extends ILogger {
export interface LoggerPort extends Logger {
debug(message: string, context?: LogContext): void;
info(message: string, context?: LogContext): void;
warn(message: string, context?: LogContext): void;

View File

@@ -1,5 +1,5 @@
import { AuthenticationState } from '../../domain/value-objects/AuthenticationState';
import type { ILogger } from '../../../shared/src/logging/ILogger';
import type { Logger } from '../../../shared/src/logging/Logger';
import { Result } from '../../../shared/result/Result';
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
import { SessionLifetime } from '../../domain/value-objects/SessionLifetime';
@@ -17,7 +17,7 @@ import type { SessionValidatorPort } from '../ports/SessionValidatorPort';
*/
export class CheckAuthenticationUseCase {
constructor(
private readonly logger: ILogger,
private readonly logger: Logger,
private readonly authService: AuthenticationServicePort,
private readonly sessionValidator?: SessionValidatorPort
) {}

View File

@@ -1,6 +1,6 @@
import { Result } from '../../../shared/result/Result';
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
import type { ILogger } from '../../../shared/src/logging/ILogger';
import type { Logger } from '../../../shared/src/logging/Logger';
/**
* Use case for clearing the user's session (logout).
@@ -11,7 +11,7 @@ import type { ILogger } from '../../../shared/src/logging/ILogger';
export class ClearSessionUseCase {
constructor(
private readonly authService: AuthenticationServicePort,
private readonly logger: ILogger, // Inject ILogger
private readonly logger: Logger, // Inject Logger
) {}
/**

View File

@@ -1,10 +1,10 @@
import { Result } from '../../../shared/result/Result';
import { RaceCreationResult } from '../../domain/value-objects/RaceCreationResult';
import type { CheckoutServicePort } from '../ports/CheckoutServicePort';
import type { ILogger } from '../../../shared/src/logging/ILogger';
import type { Logger } from '../../../shared/src/logging/Logger';
export class CompleteRaceCreationUseCase {
constructor(private readonly checkoutService: CheckoutServicePort, private readonly logger: ILogger) {}
constructor(private readonly checkoutService: CheckoutServicePort, private readonly logger: Logger) {}
async execute(sessionId: string): Promise<Result<RaceCreationResult>> {
this.logger.debug(`Attempting to complete race creation for session ID: ${sessionId}`);

View File

@@ -1,5 +1,5 @@
import { Result } from '../../../shared/result/Result';
import type { ILogger } from '../../../shared/src/logging/ILogger';
import type { Logger } from '../../../shared/src/logging/Logger';
import type { CheckoutServicePort } from '../ports/CheckoutServicePort';
import type { CheckoutConfirmationPort } from '../ports/CheckoutConfirmationPort';
import { CheckoutStateEnum } from '../../domain/value-objects/CheckoutState';
@@ -16,7 +16,7 @@ export class ConfirmCheckoutUseCase {
constructor(
private readonly checkoutService: CheckoutServicePort,
private readonly confirmationPort: CheckoutConfirmationPort,
private readonly logger: ILogger,
private readonly logger: Logger,
) {}
async execute(sessionMetadata?: SessionMetadata): Promise<Result<void>> {

View File

@@ -1,6 +1,6 @@
import { Result } from '../../../shared/result/Result';
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
import type { ILogger } from '../../../shared/logger/ILogger';
import type { Logger } from '@gridpilot/shared/application/Logger';
/**
* Use case for initiating the manual login flow.
@@ -12,7 +12,7 @@ import type { ILogger } from '../../../shared/logger/ILogger';
export class InitiateLoginUseCase {
constructor(
private readonly authService: AuthenticationServicePort,
private readonly logger: ILogger,
private readonly logger: Logger,
) {}
/**

View File

@@ -1,5 +1,5 @@
import type { AsyncUseCase } from '@gridpilot/shared/application';
import type { ILogger } from '../../../shared/src/logging/ILogger';
import type { Logger } from '../../../shared/src/logging/Logger';
import { AutomationSession } from '../../domain/entities/AutomationSession';
import type { HostedSessionConfig } from '../../domain/types/HostedSessionConfig';
import { AutomationEnginePort } from '../ports/AutomationEnginePort';
@@ -13,7 +13,7 @@ export class StartAutomationSessionUseCase
private readonly automationEngine: AutomationEnginePort,
private readonly browserAutomation: IBrowserAutomation,
private readonly sessionRepository: SessionRepositoryPort,
private readonly logger: ILogger
private readonly logger: Logger
) {}
async execute(config: HostedSessionConfig): Promise<SessionDTO> {

View File

@@ -1,7 +1,7 @@
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
import { Result } from '../../../shared/result/Result';
import { BrowserAuthenticationState } from '../../domain/value-objects/BrowserAuthenticationState';
import type { ILogger } from '../../../shared/src/logging/ILogger';
import type { Logger } from '../../../shared/src/logging/Logger';
/**
* Use case for verifying browser shows authenticated page state.
@@ -10,7 +10,7 @@ import type { ILogger } from '../../../shared/src/logging/ILogger';
export class VerifyAuthenticatedPageUseCase {
constructor(
private readonly authService: AuthenticationServicePort,
private readonly logger: ILogger,
private readonly logger: Logger,
) {}
async execute(): Promise<Result<BrowserAuthenticationState>> {