glog
A Gleam implementation of Erlang logger inspired from Logrus API.
Task List
- [x] Write documentation
- [x] Add unit tests
-
[x] Improve API with
add_error,add_resultadd_option… - [ ] Add an API to configure the logger easier and deeper
- [ ] Implement various methodologies. Compute storage while adding, compute only on log emit or a hybrid mechanism.
Usage
import glog.{Glog}
import glog/field
import glog/arg
let logger: Glog = glog.new()
// Set recommended default config
glog.set_default_config()
// Add value and a field to log
// Print Info with template
logger
|> add("foo", "bar")
|> add_field(field.new("woo", "zoo"))
|> infof("I'll be ~p", [arg.new("back")])
Quick start
gleam run # Run the project
gleam test # Run the tests
gleam shell # Run an Erlang shellInstallation
This package can be added to your Gleam project:
gleam add glogand its documentation can be found at https://hexdocs.pm/glog.