Skip to content

Commit

Permalink
feat: remove log commentary
Browse files Browse the repository at this point in the history
  • Loading branch information
tpmpb committed Jan 16, 2025
1 parent 13869c8 commit a82680d
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/core/application/decorators/log-operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a82680d

Please sign in to comment.