Skip to content

Commit

Permalink
Lager shouldn't depend on mix. Use default truncation size if mix is …
Browse files Browse the repository at this point in the history
…not started.
  • Loading branch information
khia committed Nov 19, 2012
1 parent 796a584 commit 13f16eb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/lager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,12 @@ defmodule Lager do
false
end

defp truncation_size, do: Mix.project[:opts][:truncation_size] || 4096
defp truncation_size do
default = 4096
try do
Mix.project[:opts][:truncation_size] || default
catch
:exit, { :noproc, _ } -> default
end
end
end

1 comment on commit 13f16eb

@yrashk
Copy link

@yrashk yrashk commented on 13f16eb Nov 19, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better, but can't we just use the same approach used in exlager, which is to use compiler options?

Please sign in to comment.