Permalink
Browse files

Initial implementation

  • Loading branch information...
0 parents commit 8571c4da8d32fe7edfa134292de04b45f58bbd13 Yurii Rashkovskii committed Jun 2, 2012
Showing with 36 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +21 −0 lib/lager.ex
  3. +10 −0 mix.exs
  4. +2 −0 syrup.exs
@@ -0,0 +1,3 @@
+ebin
+deps
+builds
@@ -0,0 +1,21 @@
+defmodule Lager do
+ levels = [:debug, :info, :notice, :warning, :error, :critical, :alert, :emergency]
+
+ lc level in levels do
+ contents =
+ quote do
+ def unquote(level).(msg) do
+ log(unquote(level), msg)
+ end
+ def unquote(level).(format, args) do
+ log(unquote(level), format, args)
+ end
+ end
+ Module.eval_quoted __MODULE__, contents, file: __FILE__, line: __ENV__.line
+ end
+
+ def log(level, msg), do: :lager.log(level, Process.self, msg)
+ def log(level, format, args) when is_list(format), do: :lager.log(level, Process.self, format, args)
+ def log(level, format, args) when is_binary(format), do: log(level, binary_to_list(format), args)
+
+end
10 mix.exs
@@ -0,0 +1,10 @@
+defmodule Mix.Project do
+
+ def project do
+ [project: "Lagerex", version: "0.1",
+ compile_options: [ignore_module_conflict: true, docs: true]]
+ end
+
+ def application, do: []
+
+end
@@ -0,0 +1,2 @@
+Syrup.application name: Lagerex, vsn: "0.1"
+Syrup.test_suite

0 comments on commit 8571c4d

Please sign in to comment.