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 dce39f67e8
176 changed files with 201 additions and 993 deletions

View File

@@ -1,16 +1,16 @@
import { EventEmitter } from 'node:events';
import { PassThrough } from 'node:stream';
import { getLoggerFor } from 'global-logger-factory';
import type { Logger } from 'global-logger-factory';
import { RepresentationMetadata } from '../../../../../src/http/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../../../../src/http/representation/ResourceIdentifier';
import type { Logger } from '../../../../../src/logging/Logger';
import { getLoggerFor } from '../../../../../src/logging/LogUtil';
import type { ActivityEmitter } from '../../../../../src/server/notifications/ActivityEmitter';
import type { NotificationHandler } from '../../../../../src/server/notifications/NotificationHandler';
import { AS } from '../../../../../src/util/Vocabularies';
import { flushPromises } from '../../../../util/Util';
import { StreamingHttpListeningActivityHandler, StreamingHttpMap } from '../../../../../src';
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,4 +1,6 @@
import { PassThrough } from 'node:stream';
import { getLoggerFor } from 'global-logger-factory';
import type { Logger } from 'global-logger-factory';
import type { CredentialsExtractor } from '../../../../../src/authentication/CredentialsExtractor';
import type { Authorizer } from '../../../../../src/authorization/Authorizer';
import type { PermissionReader } from '../../../../../src/authorization/PermissionReader';
@@ -10,8 +12,6 @@ import type { NotificationChannel } from '../../../../../src/server/notification
import type { HttpRequest } from '../../../../../src/server/HttpRequest';
import type { HttpResponse } from '../../../../../src/server/HttpResponse';
import { BasicRepresentation } from '../../../../../src/http/representation/BasicRepresentation';
import type { Logger } from '../../../../../src/logging/Logger';
import { getLoggerFor } from '../../../../../src/logging/LogUtil';
import {
StreamingHttpRequestHandler,
@@ -23,7 +23,7 @@ import { flushPromises } from '../../../../util/Util';
import * as GuardedStream from '../../../../../src/util/GuardedStream';
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 };
});