glog
A Gleam implementation of Erlang logger inspired from Logrus API.
Task List
- Write documentation
- Add unit tests
-
Improve API with
add_error
,add_result
add_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 shell
Installation
This package can be added to your Gleam project:
gleam add glog
and its documentation can be found at https://hexdocs.pm/glog.