Current section
Files
Jump to
Current section
Files
README.md
# Loggit
[](https://hex.pm/packages/loggit)
[](https://loggit.hexdocs.pm/)
[](https://github.com/peregrinefinch/loggit/actions/workflows/test.yml)
Loggit sends Pooka events to [Erlang/OTP Logger](https://www.erlang.org/doc/apps/kernel/logger.html).
It adds a console formatter and a typed, bounded event collector for integrations
such as an error tracker.
```pooka
module main
import loggit.{Colour, Level}
main() {
let assert Ok(_) = loggit.install_console(Colour.Auto)
let assert Ok(_) = loggit.set_level(Level.Info)
loggit.log(Level.Info, "request served", [
#("request_id", "req-42"),
#("route", "/books")
])
}
```
The default console prints a short line such as `[info] request served`.
For UTC timestamps, fields, and stack frames, call
`loggit.install_console_with_style(Colour.Auto, ConsoleStyle.Detailed)`
with `ConsoleStyle` imported. Structured collectors receive the full event
with either format.
See [the integration guide](docs/integration.md) for scoped fields, native OTP
crashes and collector behaviour.
## Licence
Licensed under the [Apache License, Version 2.0](LICENSE).