From 3e9f8f785f887cb050ea87414ecbe50686e04281 Mon Sep 17 00:00:00 2001 From: Tanmoy Sen Gupta Date: Fri, 17 Jun 2022 19:14:56 +0530 Subject: [PATCH] Revert "Added Utility for Statement-based logging #39" This reverts commit 186239434c10bbdb681f793873a35e055eb70b46. --- libraries/js/logsmith/lib/logUtility.js | 28 +++++++------------------ 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/libraries/js/logsmith/lib/logUtility.js b/libraries/js/logsmith/lib/logUtility.js index 845fd37..1295697 100644 --- a/libraries/js/logsmith/lib/logUtility.js +++ b/libraries/js/logsmith/lib/logUtility.js @@ -1,44 +1,30 @@ import chalk from 'chalk'; import format from 'string-template'; -function formatLogLevel(loglevel) { +function formatLogLevel(loglevel){ return loglevel.padEnd(8) } export function prepareJSONLog(logLevel, log, env, callback) { - const LogJSON = { + const JSONLog = { timestamp: Date.now(), logLevel: logLevel, env: env, ...log } - callback(LogJSON) + callback(JSONLog) } -export function consoleLogJSON(loglevel, chalkMode, LogJSON) { +export function consoleLogJSON(loglevel, chalkMode, JSONLog){ loglevel = formatLogLevel(loglevel) console.log( chalkMode(`[${loglevel}]`), - JSON.stringify(LogJSON) + JSON.stringify(JSONLog) ) } -export function prepareStatementLog(logLevel, log, env, logStatememtPattern, callback) { - log = { - timestamp: Date.now(), - logLevel: logLevel, - env: env, - ...log - } - const LogStatement = logStatememtPattern(log) - callback(LogStatement) -} +export function prepareStatementLog(logLevel, log, logFormat) { + -export function consoleLogStatement(loglevel, chalkMode, LogStatement) { - loglevel = formatLogLevel(loglevel) - console.log( - chalkMode(`[${loglevel}]`), - LogStatement - ) } \ No newline at end of file