README.md
# glimpse_log
[![Package Version](https://img.shields.io/hexpm/v/glimpse_log)](https://hex.pm/packages/glimpse_log)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/glimpse_log/)
A minimal cross-target gleam logging library that helps you get a glimpse into the program. Contains bindings to JavaScript and a gleam implementation for everywhere else.
Note that this is (at least currently) just a nicer API, if you want to customize output (erlang only) you will want to set up a library such as [lpil/logging](https://hexdocs.pm/logging/).
```sh
gleam add glimpse_log@1
```
```gleam
import glimpse
pub fn main() {
// You can call this on any value that can be converted to a StringBuilder via string.inspect()
glimpse.error("An error log")
glimpse.warn("A warning log")
glimpse.info("An info log")
glimpse.debug("A debug log")
// The functions return the term passed into them, so they can be used in pipes!
"A value"
|> glimpse.error
|> glimpse.warn
|> glimpse.info
|> glimpse.debug
4
|> glimpse.info
}
```
Further documentation can be found at <https://hexdocs.pm/glimpse_log>.
## Development
TODO
- Tests
- Docs
- Format Errors (Erlang: `info(Format,Args[,Metadata])`) [ref](https://www.erlang.org/docs/24/man/logger#info-2)
- Metadata for erlang logger
- format args for JS
```sh
gleam run # Run the project
gleam test # Run the tests
```