Skip to content

Commit

Permalink
Revert "Added Utility for Statement-based logging #39"
Browse files Browse the repository at this point in the history
This reverts commit 1862394.
  • Loading branch information
TanmoySG authored Jun 17, 2022
1 parent 26e485b commit 3e9f8f7
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions libraries/js/logsmith/lib/logUtility.js
Original file line number Diff line number Diff line change
@@ -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
)
}

0 comments on commit 3e9f8f7

Please sign in to comment.