Skip to content

Commit

Permalink
Revert logger usage (#388)
Browse files Browse the repository at this point in the history
* Revert logger usage

* fix: removal of consolelogger

Removes console logger in favor of Logger in producer modules
  • Loading branch information
underfisk authored Feb 2, 2022
1 parent ea15620 commit 351b6f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/hasura/src/hasura.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DiscoveryModule, DiscoveryService } from '@golevelup/nestjs-discovery';
import { createConfigurableDynamicRootModule } from '@golevelup/nestjs-modules';
import {
BadRequestException,
ConsoleLogger,
Logger,
Module,
OnModuleInit,
} from '@nestjs/common';
Expand Down Expand Up @@ -74,7 +74,7 @@ export class HasuraModule
)
implements OnModuleInit
{
private readonly logger = new ConsoleLogger(HasuraModule.name);
private readonly logger = new Logger(HasuraModule.name);

constructor(
private readonly discover: DiscoveryService,
Expand Down
6 changes: 2 additions & 4 deletions packages/rabbitmq/src/amqp/connection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConsoleLogger } from '@nestjs/common';
import { Logger } from '@nestjs/common';
import {
ChannelWrapper,
AmqpConnectionManager,
Expand Down Expand Up @@ -62,9 +62,7 @@ const defaultConfig = {

export class AmqpConnection {
private readonly messageSubject = new Subject<CorrelationMessage>();
private readonly logger: ConsoleLogger = new ConsoleLogger(
AmqpConnection.name
);
private readonly logger = new Logger(AmqpConnection.name);
private readonly initialized = new Subject<void>();
private _managedConnection!: AmqpConnectionManager;
/**
Expand Down
8 changes: 4 additions & 4 deletions packages/rabbitmq/src/rabbitmq.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import {
DynamicModule,
Module,
ConsoleLogger,
Logger,
OnApplicationBootstrap,
OnApplicationShutdown,
} from '@nestjs/common';
Expand Down Expand Up @@ -44,7 +44,7 @@ export class RabbitMQModule
)
implements OnApplicationBootstrap, OnApplicationShutdown
{
private readonly logger = new ConsoleLogger(RabbitMQModule.name);
private readonly logger = new Logger(RabbitMQModule.name);

constructor(
private readonly discover: DiscoveryService,
Expand All @@ -57,13 +57,13 @@ export class RabbitMQModule
static async AmqpConnectionFactory(config: RabbitMQConfig) {
const connection = new AmqpConnection(config);
await connection.init();
const logger = new ConsoleLogger(RabbitMQModule.name);
const logger = new Logger(RabbitMQModule.name);
logger.log('Successfully connected to RabbitMQ');
return connection;
}

public static build(config: RabbitMQConfig): DynamicModule {
const logger = new ConsoleLogger(RabbitMQModule.name);
const logger = new Logger(RabbitMQModule.name);
logger.warn(
'build() is deprecated. use forRoot() or forRootAsync() to configure RabbitMQ'
);
Expand Down
4 changes: 2 additions & 2 deletions packages/stripe/src/stripe.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DiscoveryModule, DiscoveryService } from '@golevelup/nestjs-discovery';
import { createConfigurableDynamicRootModule } from '@golevelup/nestjs-modules';
import { ConsoleLogger, Module, OnModuleInit } from '@nestjs/common';
import { Logger, Module, OnModuleInit } from '@nestjs/common';
import { PATH_METADATA } from '@nestjs/common/constants';
import { ExternalContextCreator } from '@nestjs/core/helpers/external-context-creator';
import { flatten, groupBy } from 'lodash';
Expand Down Expand Up @@ -68,7 +68,7 @@ export class StripeModule
)
implements OnModuleInit
{
private readonly logger = new ConsoleLogger(StripeModule.name);
private readonly logger = new Logger(StripeModule.name);

constructor(
private readonly discover: DiscoveryService,
Expand Down

0 comments on commit 351b6f0

Please sign in to comment.