Skip to content

Commit

Permalink
Updated Example Files for #39
Browse files Browse the repository at this point in the history
  • Loading branch information
TanmoySG authored May 17, 2022
1 parent 3d9b53b commit 82152fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion libraries/js/examples/configs/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"env": "test",
"logfile": null,
"consoleOnly": false,
"logStatementPattern": "{timestamp} | {name}",
"logStatementPattern": "[ {component} ~ {status} ] : {message}",
"logFormat" : "statement"
}
29 changes: 18 additions & 11 deletions libraries/js/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" })
logg.WARN(SampleLog)
logg.INFO(SampleLog)
logg.SUCCESS(SampleLog)
logg.FAILURE(SampleLog)
logg.CRITICAL(SampleLog)
logg.LOG("TRAILING", SampleLog)

0 comments on commit 82152fa

Please sign in to comment.