From 3c85467b0247bd9f2d7d83b7d43a97d7ae7e7a45 Mon Sep 17 00:00:00 2001 From: Amir Ghezelbash Date: Tue, 26 Nov 2024 15:08:26 +0330 Subject: [PATCH] chore: Revert "chore: Serialize object arguments in desktop runtime (#18359)" (#18382) This reverts commit c93b3d0c7d233e48ef09f8bc5eaf349148cbb7d1. --- src/script/util/Logger.ts | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/script/util/Logger.ts b/src/script/util/Logger.ts index f69d710ce92..b2213831718 100644 --- a/src/script/util/Logger.ts +++ b/src/script/util/Logger.ts @@ -17,42 +17,15 @@ * */ -import {LogFactory, Logger, Runtime} from '@wireapp/commons'; +import {LogFactory, Logger} from '@wireapp/commons'; const LOGGER_NAMESPACE = '@wireapp/webapp'; -function serializeArgs(args: any[]): any[] { - return args.map(arg => (typeof arg === 'object' && arg !== null ? JSON.stringify(arg) : arg)); -} - function getLogger(name: string): Logger { - const logger = LogFactory.getLogger(name, { + return LogFactory.getLogger(name, { namespace: LOGGER_NAMESPACE, separator: '/', }); - - if (Runtime.isDesktopApp()) { - return { - ...logger, - debug: (...args: any[]): void => { - logger.debug(...serializeArgs(args)); - }, - error: (...args: any[]): void => { - logger.error(...serializeArgs(args)); - }, - info: (...args: any[]): void => { - logger.info(...serializeArgs(args)); - }, - log: (...args: any[]): void => { - logger.log(...serializeArgs(args)); - }, - warn: (...args: any[]): void => { - logger.warn(...serializeArgs(args)); - }, - }; - } - - return logger; } export {getLogger, LOGGER_NAMESPACE, Logger};