summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMickael Remond <mremond@process-one.net>2016-04-01 11:11:42 +0200
committerMickael Remond <mremond@process-one.net>2016-04-01 11:11:42 +0200
commita8f92ae767eee39100bec38ff32fe39d017dabcb (patch)
tree28e8451c9cd458c7e2af585473f17d79a3326598 /include
parentPort mod_admin_extra test to work with new API (diff)
Add logger macro to help troubleshooting Elixir tests
Diffstat (limited to 'include')
-rw-r--r--include/logger.hrl7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/logger.hrl b/include/logger.hrl
index 18dc7041..df077686 100644
--- a/include/logger.hrl
+++ b/include/logger.hrl
@@ -34,3 +34,10 @@
-define(CRITICAL_MSG(Format, Args),
lager:critical(Format, Args)).
+
+%% Use only when trying to troubleshoot test problem with ExUnit
+-define(EXUNIT_LOG(Format, Args),
+ case lists:keyfind(logger, 1, application:loaded_applications()) of
+ false -> ok;
+ _ -> 'Elixir.Logger':bare_log(error, io_lib:format(Format, Args), [?MODULE])
+ end).