Skip to content

Commit

Permalink
fix service impl
Browse files Browse the repository at this point in the history
  • Loading branch information
tmthecoder committed Mar 30, 2024
1 parent 85fc732 commit a368a42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/logging-service/src/modules/logging/logging.controller.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
import { Controller } from '@nestjs/common';
import { LoggingService } from './logging.service';
import { LoggingProto } from 'juno-proto';
import { Observable } from 'rxjs';

@Controller()
@LoggingProto.LoggingServiceControllerMethods()
export class LoggingController
implements LoggingProto.LoggingServiceController
{
constructor(private readonly loggingService: LoggingService) {}
async recordError(
request: LoggingProto.ErrorLogRequest,
): Promise<LoggingProto.ErrorLogResponse> {
if (!request.message) {
console.log('Invalid parameters');
} else {
try {
await this.loggingService.recordError(request);
return {};
} catch (error) {
console.log('Error occured');
}
}
}
async recordInfo(
request: LoggingProto.RecordInfoRequest,
): Promise<LoggingProto.RecordInfoResponse> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ export class LoggingService {
async recordInfo(request: LoggingProto.RecordInfoRequest): Promise<any> {
return {};
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
async recordError(request: LoggingProto.RecordInfoRequest): Promise<any> {
return {};
}
}

0 comments on commit a368a42

Please sign in to comment.