From be3907d2ed1c30cc282fe7acd0556df424044815 Mon Sep 17 00:00:00 2001 From: walrusVision Date: Tue, 28 Feb 2017 10:23:12 +1300 Subject: [PATCH] Updated README. Fixed tests for older OTP versions --- README.md | 7 ++++--- test/lager_test_function_transform.erl | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a48fc79..a03e48d 100644 --- a/README.md +++ b/README.md @@ -654,9 +654,10 @@ The MF called should take no arguments and should return a value that can be be This metadata is also persistent across processes. -**IMPORTANT**: Since you can calling functions, be aware that using these -could have an impact on your logging performance depending on what the call -will need to do. +**IMPORTANT**: Since this feature relies on function calls injected at the +point where a log message is emitted, your logging performance (ops/sec) +will be impacted by what the functions you call do and how much latency they +may introduce. Setting the truncation limit at compile-time diff --git a/test/lager_test_function_transform.erl b/test/lager_test_function_transform.erl index b294f03..82e3f01 100644 --- a/test/lager_test_function_transform.erl +++ b/test/lager_test_function_transform.erl @@ -44,7 +44,12 @@ transform_static() -> static_result. transform_dynamic() -> - erlang:monotonic_time(). + case lager_util:otp_version() >= 18 of + true -> + erlang:monotonic_time() + false -> + erlang:now() + end. not_running_test() -> ?assertEqual({error, lager_not_running}, lager:log(info, self(), "not running")).