glog

Package Version Hex Docs

A Gleam implementation of Erlang logger inspired from Logrus API.

Task List

Usage

The Erlang logger is asynchronous by default, please read the logger chapter

import glog
import glog/field
import glog/arg
import glog/level


pub fn main() {
 let logger = glog.new()
 glog.set_primary_log_level(level.All)
 glog.set_default_config()

 logger
 |> glog.add("foo", "bar")
 |> glog.add_field(field.new("woo", "zoo"))
 |> glog.infof("I'll be ~p", [arg.new("back")])
}

Things to know

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.

Search Document