feat: Replace logging with external library

This commit is contained in:
Joachim Van Herwegen
2024-08-29 09:25:29 +02:00
parent 3902eccbde
commit 7c98751aa2
176 changed files with 201 additions and 993 deletions

View File

@@ -1,12 +1,12 @@
import { DataFactory, Store } from 'n3';
import { getLoggerFor } from 'global-logger-factory';
import type { Logger } from 'global-logger-factory';
import {
AbsolutePathInteractionRoute,
} from '../../../../../src/identity/interaction/routing/AbsolutePathInteractionRoute';
import {
RelativePathInteractionRoute,
} from '../../../../../src/identity/interaction/routing/RelativePathInteractionRoute';
import type { Logger } from '../../../../../src/logging/Logger';
import { getLoggerFor } from '../../../../../src/logging/LogUtil';
import { CONTEXT_NOTIFICATION } from '../../../../../src/server/notifications/Notification';
import type { NotificationChannel } from '../../../../../src/server/notifications/NotificationChannel';
import type { StateHandler } from '../../../../../src/server/notifications/StateHandler';
@@ -22,7 +22,7 @@ import quad = DataFactory.quad;
import blankNode = DataFactory.blankNode;
import namedNode = DataFactory.namedNode;
jest.mock('../../../../../src/logging/LogUtil', (): any => {
jest.mock('global-logger-factory', (): any => {
const logger: Logger =
{ error: jest.fn() } as any;
return { getLoggerFor: (): Logger => logger };

View File

@@ -1,13 +1,13 @@
import fetch from 'cross-fetch';
import { calculateJwkThumbprint, exportJWK, generateKeyPair, importJWK, jwtVerify } from 'jose';
import { getLoggerFor } from 'global-logger-factory';
import type { Logger } from 'global-logger-factory';
import { BasicRepresentation } from '../../../../../src/http/representation/BasicRepresentation';
import type { Representation } from '../../../../../src/http/representation/Representation';
import type { AlgJwk, JwkGenerator } from '../../../../../src/identity/configuration/JwkGenerator';
import {
AbsolutePathInteractionRoute,
} from '../../../../../src/identity/interaction/routing/AbsolutePathInteractionRoute';
import type { Logger } from '../../../../../src/logging/Logger';
import { getLoggerFor } from '../../../../../src/logging/LogUtil';
import type { Notification } from '../../../../../src/server/notifications/Notification';
import type {
WebhookChannel2023,
@@ -20,7 +20,7 @@ import { NOTIFY } from '../../../../../src/util/Vocabularies';
jest.mock('cross-fetch');
jest.mock('../../../../../src/logging/LogUtil', (): any => {
jest.mock('global-logger-factory', (): any => {
const logger: Logger =
{ error: jest.fn(), debug: jest.fn() } as any;
return { getLoggerFor: (): Logger => logger };