basho/lager — pull request #105 by Vagabond (2012-12-18 20:20:59+00:00)
Title: Tracing without using parse transform.

Hi,

I'm trying to use the tracing provided by Lager without using the parse transform. I'm not sure about how to do that (if it's possible), and I might be doing something wrong. I do the following:

```
lager:trace_file("log/test.log", [{test, "Test"}]).
```

and then I log using:

```
lager:log(info, [{test, "Test"}], "This is a message", []).
```

But the logs get written to all the files, not only to log/test.log. Also, if I just log using

```
lager:log(info, self(), "This is a message", []).
```

also the message gets written to all the files (including log/test.log).

Am I doing something wrong?

I also found that the function lager:status() fails sometimes.

```
Erlang R15B01 (erts-5.9.1) [source] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.1 (abort with ^G)
1> lager:start().
10:10:10.003 [info] Application lager started on node nonode@nohost
ok
2> lager:status().
Lager status:
File log/console.log at level info
File log/error.log at level error
Console at level info
Active Traces:
ok
3> lager:trace_file("logs/example.com.error", [{vhost, "example.com"}], error).
{ok,{[{vhost,"example.com"}],
{mask,15},
{lager_file_backend,"logs/example.com.error"}}}
4> lager:status().
** exception error: no function clause matching lager_util:num_to_level({mask,15}) (src/lager_util.erl, line 45)
in function lager:'-status/0-lc$^1/1-1-'/1 (src/lager.erl, line 209)
in call from lager:status/0 (src/lager.erl, line 207)
```

I don't whether this is an error or my mistake.

Thanks for your help!