Roowe
f797f99218
support disable pretty printing records encountered at compile time
11 vuotta sitten
Andrew Thompson
98143ae182
Allow storage of persistant per-process lager metadata
For persistant processes with some immutable metadata (riak vnode and
the vnode ID, for example), implement lager:md/0 and lager:md/1 for
getting/setting such metadata into the process dictionary.
Such metadata is automatically included in any lager message metadata,
so you can just set it in your init() function or whatever and not have
to worry about passing the data around and using it in every lager call.
12 vuotta sitten
Andrew Thompson
0d42da447b
Generate variable names with a function, suggested by @mshonle
12 vuotta sitten
Andrew Thompson
a454d1f2d1
In code generated by the parse_transform skip unloggable messages fast
Originally an idea that Dizzy forwarded to me from Tony Rogvall.
Basicially all the work lager does gathering metadata and stuff is
wrapped in a case statement that fails-fast if the message is definitely
not going to be logged; the severity isn't currently being consumed and
there's no traces installed.
In my simple test, logging 1 million debug messages, when the debug
level is not being consumed, goes from taking 2.99 seconds to 1.21
seconds with this change.
Also, lager pre 1.0 actually had something similar to this, but it was
removed during a refactor and never re-added.
12 vuotta sitten
Andrew Thompson
0ec0d9055b
Also allow list comps, function calls and record fields as lager arguments
12 vuotta sitten
Andrew Thompson
95fdf935b9
Support variables as arguments to lager:info and friends
As long as *one* of the arguments is a literal, lager can figure out
what you're trying to do and (re)arrange the arguments as necessary.
12 vuotta sitten
Andrew Thompson
9bd0a411a3
Support pretty printing records found in a module at compile time
12 vuotta sitten
Andrew Thompson
45f833e5db
Attempt to determine application at compile time and store in metadata
12 vuotta sitten
Tilman Holschuh
84034aa512
added "node" to metadata in parse transform
12 vuotta sitten
Andrew Thompson
12a784b18e
Time makes fools of us all
12 vuotta sitten
Andrew Thompson
55283cc2c2
Make the default truncation limit a macro
12 vuotta sitten
Andrew Thompson
05718792ae
Whitespace cleanups
13 vuotta sitten
Jason Wagner
0415d21669
Changed the messages sent to the backends to include metadata and separated formatting from the backend. Added documentation, fixed tests, and removed some unused code.
13 vuotta sitten
Devin Torres
80a0e9f5c1
Add support for a custom log truncation size compile time flag
13 vuotta sitten
Jason Wagner
2f9b7936d6
Moved a lot of the AST in lager_transform into a function to make things easier to read and modify
Additional changes and formatting by Andrew Thompson
13 vuotta sitten
Andrew Thompson
ed7bc9a8a8
Add pid to the list of attributes automatically captured for tracing
13 vuotta sitten
Andrew Thompson
121c4c5241
Initial implementation of 'tracing'
13 vuotta sitten
Andrew Thompson
40b0e2d484
Record milliseconds with timestamps, make console less verbose by default
az558
13 vuotta sitten
Andrew Thompson
ec61e88d8a
Make the dialyzer happy.
14 vuotta sitten
Andrew Thompson
077f218cd9
Make logging not crash when lager is not running
14 vuotta sitten
Andrew Thompson
db725a90ba
Add support for parameterized modules to the parse transform
14 vuotta sitten
Andrew Thompson
9cbb72c3ca
Cleanup some commented out code
14 vuotta sitten
Andrew Thompson
886d410eb9
Make highest log level be 0; add some helper macros
14 vuotta sitten
Andrew Thompson
862a9cb46c
Documentation!
14 vuotta sitten
Andrew Thompson
a1fe3f4496
Remove riak_err as a dep; fix some warnings
14 vuotta sitten
Andrew Thompson
f5ec15a68d
Resolve severity at runtime
14 vuotta sitten
Andrew Thompson
761642eddb
Add ability to adjust loglevel per handler at runtime
14 vuotta sitten
Andrew Thompson
c172c0e8d2
Fix parse_transform to recurse the AST more
14 vuotta sitten
Andrew Thompson
7bcf044f1a
Initial import
14 vuotta sitten