Skip to content

Commit

Permalink
Fixed logging
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasbordeau committed Nov 14, 2024
1 parent ea89cc3 commit d83400b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable, LoggerService } from '@nestjs/common';
import { Injectable, Logger } from '@nestjs/common';

import { Record as ObjectRecord } from 'src/engine/api/graphql/workspace-query-builder/interfaces/record.interface';
import { QueryResultFieldValue } from 'src/engine/api/graphql/workspace-query-runner/factories/query-result-getters/interfaces/query-result-field-value';
Expand All @@ -15,6 +15,7 @@ import { isQueryResultFieldValueAConnection } from 'src/engine/api/graphql/works
import { isQueryResultFieldValueANestedRecordArray } from 'src/engine/api/graphql/workspace-query-runner/factories/query-result-getters/utils/is-query-result-field-value-a-nested-record-array.guard';
import { isQueryResultFieldValueARecordArray } from 'src/engine/api/graphql/workspace-query-runner/factories/query-result-getters/utils/is-query-result-field-value-a-record-array.guard';
import { isQueryResultFieldValueARecord } from 'src/engine/api/graphql/workspace-query-runner/factories/query-result-getters/utils/is-query-result-field-value-a-record.guard';
import { CompositeInputTypeDefinitionFactory } from 'src/engine/api/graphql/workspace-schema-builder/factories/composite-input-type-definition.factory';
import { FileService } from 'src/engine/core-modules/file/services/file.service';
import { ObjectMetadataMap } from 'src/engine/metadata-modules/utils/generate-object-metadata-map.util';
import { isRelationFieldMetadataType } from 'src/engine/utils/is-relation-field-metadata-type.util';
Expand All @@ -25,12 +26,12 @@ import { isDefined } from 'src/utils/is-defined';
// Right now the factory will override any change made on relations by the handlers
@Injectable()
export class QueryResultGettersFactory {
private readonly logger = new Logger(
CompositeInputTypeDefinitionFactory.name,
);
private handlers: Map<string, QueryResultGetterHandlerInterface>;

constructor(
private readonly fileService: FileService,
private readonly loggerService: LoggerService,
) {
constructor(private readonly fileService: FileService) {
this.initializeHandlers();
}

Expand Down Expand Up @@ -215,7 +216,7 @@ export class QueryResultGettersFactory {
workspaceId,
);
} else {
this.loggerService.warn(
this.logger.warn(
`Query result field is not a record, connection, nested record array or record array.
This is an undetected case in query result getter that should be implemented !!`,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { AuthModule } from 'src/engine/core-modules/auth/auth.module';
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
import { FileModule } from 'src/engine/core-modules/file/file.module';
import { LoggerModule } from 'src/engine/core-modules/logger/logger.module';
import { TelemetryModule } from 'src/engine/core-modules/telemetry/telemetry.module';
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
Expand All @@ -31,7 +30,6 @@ import { EntityEventsToDbListener } from './listeners/entity-events-to-db.listen
TelemetryModule,
FileModule,
FeatureFlagModule,
LoggerModule,
],
providers: [
...workspaceQueryRunnerFactories,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { DynamicModule, Global, ConsoleLogger, Module } from '@nestjs/common';
import { ConsoleLogger, DynamicModule, Global, Module } from '@nestjs/common';

import { LoggerService } from 'src/engine/core-modules/logger/logger.service';
import { LoggerDriverType } from 'src/engine/core-modules/logger/interfaces';
import { LOGGER_DRIVER } from 'src/engine/core-modules/logger/logger.constants';
import {
ASYNC_OPTIONS_TYPE,
ConfigurableModuleClass,
OPTIONS_TYPE,
} from 'src/engine/core-modules/logger/logger.module-definition';
import { LoggerDriverType } from 'src/engine/core-modules/logger/interfaces';
import { LoggerService } from 'src/engine/core-modules/logger/logger.service';

@Global()
@Module({
Expand Down

0 comments on commit d83400b

Please sign in to comment.