Skip to content

Instantly share code, notes, and snippets.

@cbd
Created May 17, 2012 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbd/2721668 to your computer and use it in GitHub Desktop.
Save cbd/2721668 to your computer and use it in GitHub Desktop.
wrapper for basho's lager in Elixir
defmodule Lager do
# debug | info | notice | warning | error | critical | alert | emergency
def debug msg do
Lager.log(:debug,msg)
end
def info msg do
Lager.log(:info,msg)
end
def notice msg do
Lager.log(:notice,msg)
end
def warning msg do
Lager.log(:warning,msg)
end
def error msg do
Lager.log(:error,msg)
end
def critical msg do
Lager.log(:critical,msg)
end
def alert msg do
Lager.log(:alert,msg)
end
def emergency msg do
Lager.log(:emergency,msg)
end
def log(level,msg) do
:lager.log(level,Process.self(),msg)
end
end
@yrashk
Copy link

yrashk commented Jun 2, 2012

This is just wrong :) this should have been implemented as a macro :)

@yrashk
Copy link

yrashk commented Jun 2, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment