Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tests and docs

  • Loading branch information...
commit da11108d93d95660e1e1045dfbb039dfdcf43798 1 parent f397fea
garry authored
Showing with 16 additions and 2 deletions.
  1. +1 −1  README.md
  2. +15 −1 src/alog_tests.erl
View
2  README.md
@@ -125,7 +125,7 @@ alogger can be configured to write different flows (or streams of log messages)
* TagList is list of tags, Every tag is atom. If you set tag as filter, printouts with pointed tags is sent to loggers. Name of modules are no matter in this case.
-* ModList is list of modules which should be logged to loggers. Tags are no matter.
+* ModList is list of modules which should be logged to loggers. Tags are no matter. When ModList is set to ['\_'] log message from any module will be printed. Also you can set exceptions using [{'\_', not_for, ExModList}] where ExModList is list of modules which should not be logged.
View
16 src/alog_tests.erl
@@ -56,7 +56,13 @@ base_test_() ->
[?assertEqual(error, priority_work(P)) || P <- GreatPriority],
LowPriority = get_low_priorities(CP),
[?assertEqual(ok, priority_work(P)) || P <- [CP | LowPriority]]
- end || CP <- ?all_priorities])}]}.
+ end || CP <- ?all_priorities])},
+ {"not_for filter",
+ ?_test(begin
+ ok = set_max_priority(),
+ ok = set_not_for_filter(),
+ [?assertEqual(error, priority_work(P)) || P <- ?all_priorities]
+ end)}]}.
install_test_logger_iface() ->
ok = application:start(sasl),
@@ -89,6 +95,14 @@ set_priority(P) ->
ok = alog_control:set_flow_priority(1, {'=<', P}),
ok.
+set_not_for_filter() ->
+ ok = set_filter({mod,[{'_', not_for,[?MODULE]}]}),
+ ok.
+
+set_filter(F) ->
+ ok = alog_control:set_flow_filter(1, F),
+ ok.
+
priority_work(?debug) ->
Ref = make_ref(),
?DBG("test debug ~p", [Ref]),
Please sign in to comment.
Something went wrong with that request. Please try again.