From a82680d149375ab498ad599109b267d7b57caae4 Mon Sep 17 00:00:00 2001 From: Paulo Barbosa Date: Thu, 16 Jan 2025 15:32:22 -0300 Subject: [PATCH] feat: remove log commentary --- .../application/decorators/log-operation.ts | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/core/application/decorators/log-operation.ts b/src/core/application/decorators/log-operation.ts index 55cf37d7..0df667ad 100644 --- a/src/core/application/decorators/log-operation.ts +++ b/src/core/application/decorators/log-operation.ts @@ -31,27 +31,25 @@ export function LogOperation(options: { // Overrides the method descriptor.value = async function (...args: any[]) { const midazLogger: LoggerAggregator = (this as any).loggerAggregator - // const isDebugEnabled = process.env.ENABLE_DEBUG === 'true' + const isDebugEnabled = process.env.ENABLE_DEBUG === 'true' try { - // logger.addEvent({ - // layer: options.layer, - // operation: `${options.operation}_start`, - // level: 'info', - // message: `Starting ${options.operation}`, - // ...(isDebugEnabled && { metadata: { args } }) - // }) + midazLogger.info({ + layer: options.layer, + operation: `${options.operation}_start`, + level: 'info', + message: `Starting ${options.operation}`, + ...(isDebugEnabled && { metadata: { args } }) + }) const result = await originalMethod.apply(this, args) - // logger.addEvent({ - // layer: options.layer, - // operation: `${options.operation}_success`, - // level: 'info', - // message: `${options.operation} completed successfully`, - // // metadata: { result } //comentario aqui para remover o payload - // ...(isDebugEnabled && { metadata: { result } }) - // }) + midazLogger.info({ + layer: options.layer, + operation: `${options.operation}_success`, + message: `${options.operation} completed successfully`, + ...(isDebugEnabled && { metadata: { result } }) + }) return result } catch (error) {