Óg

Óg is a small collection of logger helper functions in elixir.

Installation

Add óg to your list of dependencies in mix.exs:

def deps, do: [{:og, "~> 0.0.5"}]

Project Features

Example Usage

Og.log/3

Og.log(String.to_atom("test"))

Og.log/3 where the line, function module also needs to be logged.

Og.log(String.to_atom("test"), __ENV__, :warn)

Og.log_return/3

%{first: "john", last: "doe"}
|> Map.to_list()
|> Enum.filter( &(&1 === {:first, "john"}))
|> Og.log_return()
|> List.last()
|> Tuple.to_list()
|> List.last()
|> Og.log_return(:warn)
|> String.upcase()

Og.context/3

defmodule Test do
  def env_test() do
    Og.context(__ENV__, :info)
  end
end

Test.env_test()

Og.conn_context/3

defmodule Test do
  use Plug.Test
  def test() do
    conn = Plug.Test.conn(:get, "/test", :nil)
    Og.conn_context(conn, __ENV__, :debug)
  end
end

Test.test()

Licence

MIT