8000 GitHub - mna/flash: Flash is a Gleam package enabling structured logging in both Erlang and JavaScript environments
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ flash Public
forked from larzconwell/flash

Flash is a Gleam package enabling structured logging in both Erlang and JavaScript environments

License

Notifications You must be signed in to change notification settings

mna/flash

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flash

Package Version Hex Docs License Test

flash is a Gleam package enabling structured logging in both Erlang and JavaScript environments.

Usage

gleam add flash

With the default text writer output:

import flash.{InfoLevel, GroupAttr, StringAttr}

pub fn main() {
  flash.new(InfoLevel, flash.text_writer)
  |> flash.with_group("request")
  |> flash.with_attrs([
    StringAttr("method", "POST"),
    StringAttr("path", "/user/create"),
    StringAttr("id", "foobar"),
  ])
  |> flash.info("request")
}
21:24:12 INFO  request                                       request.id=foobar request.method=POST request.path=/user/create

With the default json writer output:

import flash.{InfoLevel, GroupAttr, StringAttr}

pub fn main() {
  flash.new(InfoLevel, flash.json_writer)
  |> flash.with_group("request")
  |> flash.with_attrs([
    StringAttr("method", "POST"),
    StringAttr("path", "/user/create"),
    StringAttr("id", "foobar"),
  ])
  |> flash.info("request")
}
{"level":"info","time":"2024-03-12T21:25:03.022-04:00","message":"request","request":{"id":"foobar","method":"POST","path":"/user/create"}}

Developing

ln -s $(pwd)/.hooks/pre-commit .git/hooks/pre-commit
gleam format
gleam build
gleam test

About

Flash is a Gleam package enabling structured logging in both Erlang and JavaScript environments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Gleam 98.7%
  • Shell 1.3%
0