From 82152fa488d670a8f4b82251e62890aec33f86c7 Mon Sep 17 00:00:00 2001 From: Tanmoy Sen Gupta Date: Tue, 17 May 2022 20:08:43 +0000 Subject: [PATCH] Updated Example Files for #39 --- libraries/js/examples/configs/jsonConfig.json | 2 +- libraries/js/examples/index.js | 29 ++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/libraries/js/examples/configs/jsonConfig.json b/libraries/js/examples/configs/jsonConfig.json index 66738a1..77818c9 100644 --- a/libraries/js/examples/configs/jsonConfig.json +++ b/libraries/js/examples/configs/jsonConfig.json @@ -2,6 +2,6 @@ "env": "test", "logfile": null, "consoleOnly": false, - "logStatementPattern": "{timestamp} | {name}", + "logStatementPattern": "[ {component} ~ {status} ] : {message}", "logFormat" : "statement" } \ No newline at end of file diff --git a/libraries/js/examples/index.js b/libraries/js/examples/index.js index 5da87ec..23f9f0b 100644 --- a/libraries/js/examples/index.js +++ b/libraries/js/examples/index.js @@ -2,18 +2,25 @@ import Logsmith from "../logsmith/logsmith.js"; const logg = new Logsmith({}) +const SampleLog = { + status: "running", + component : "logger", + message: "The Test is Fine" +} -logg.WARN({ name: "tanmoy" }) +logg.WARN(SampleLog) +logg.INFO(SampleLog) +logg.SUCCESS(SampleLog) +logg.FAILURE(SampleLog) +logg.CRITICAL(SampleLog) +logg.LOG("TRAILING", SampleLog) -// logg.INFO({ name: "tanmoy" }) - -// logg.SUCCESS({ name: "tanmoy" }) +console.log() logg.fetchConfigFromFile("./libraries/js/examples/configs/jsonConfig.json") -logg.INFO({ name: "tanmoy" }) - -// logg.FAILURE({ name: "tanmoy" }) - -// logg.CRITICAL({ name: "tanmoy" }) - -// logg.LOG("TRAILING", { name: "Tanmoy" }) \ No newline at end of file +logg.WARN(SampleLog) +logg.INFO(SampleLog) +logg.SUCCESS(SampleLog) +logg.FAILURE(SampleLog) +logg.CRITICAL(SampleLog) +logg.LOG("TRAILING", SampleLog) \ No newline at end of file