https://github.com/wervice/birch
Uniform logging for many languages
https://github.com/wervice/birch
logging logging-framework logging-library
Last synced: 11 months ago
JSON representation
Uniform logging for many languages
- Host: GitHub
- URL: https://github.com/wervice/birch
- Owner: Wervice
- Created: 2024-05-12T17:57:33.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T22:02:40.000Z (almost 2 years ago)
- Last Synced: 2024-05-13T19:24:15.052Z (almost 2 years ago)
- Topics: logging, logging-framework, logging-library
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Birch
One uniform logger for many languages
## Ussage
1. Include birch into your code
a) Copy contents from birch file into your code
b) Require/Include/Import... birch file in your code
2. Define variables
|Variable Name|Description|Example value|
|-------------|-----------|-------------|
|birch_path|Path to the log file to write into|`"../birch.log"`|
|birch_verbose|Enable verbose logging messages|false|
3. Call birch function
Birch provides one new function: `birch(level, message)`
You have to pass a level and a message to the function.
Supported levels are:
|Short level name|Level name|Level number|Level letter|
|----------|----------------|------------|------------|
|verbo|verbose|0|V|
|succ|success|1|S|
|warn|warning|2|W|
|erro|error|3|E|
|fata|fatal|4|F|
You can now simply read the log file or look for logs in the terminal.
Every log entry will be built like this:
`[LEVEL] HH:MM:SS:MS mm/dd/YY | Message`
## Examples
```javascript
// JavaScript
const birch_path = "./.log"
const birch_verbose = true
eval(fs.readFileSync("birch.mjs").toString("ascii")) // Eval birch into project
birch("succ", "Start program");
birch("warn", "There is not much in this program")
```