diff options
-rw-r--r-- | src/couch_log/src/couch_log.erl | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/src/couch_log/src/couch_log.erl b/src/couch_log/src/couch_log.erl index a80d4a477..a8dc5d48d 100644 --- a/src/couch_log/src/couch_log.erl +++ b/src/couch_log/src/couch_log.erl @@ -28,51 +28,35 @@ -spec debug(string(), list()) -> ok. -debug(Fmt, Args) -> - couch_stats:increment_counter([couch_log, level, debug]), - log(debug, Fmt, Args). +debug(Fmt, Args) -> log(debug, Fmt, Args). -spec info(string(), list()) -> ok. -info(Fmt, Args) -> - couch_stats:increment_counter([couch_log, level, info]), - log(info, Fmt, Args). +info(Fmt, Args) -> log(info, Fmt, Args). -spec notice(string(), list()) -> ok. -notice(Fmt, Args) -> - couch_stats:increment_counter([couch_log, level, notice]), - log(notice, Fmt, Args). +notice(Fmt, Args) -> log(notice, Fmt, Args). -spec warning(string(), list()) -> ok. -warning(Fmt, Args) -> - couch_stats:increment_counter([couch_log, level, warning]), - log(warning, Fmt, Args). +warning(Fmt, Args) -> log(warning, Fmt, Args). -spec error(string(), list()) -> ok. -error(Fmt, Args) -> - couch_stats:increment_counter([couch_log, level, error]), - log(error, Fmt, Args). +error(Fmt, Args) -> log(error, Fmt, Args). -spec critical(string(), list()) -> ok. -critical(Fmt, Args) -> - couch_stats:increment_counter([couch_log, level, critical]), - log(critical, Fmt, Args). +critical(Fmt, Args) -> log(critical, Fmt, Args). -spec alert(string(), list()) -> ok. -alert(Fmt, Args) -> - couch_stats:increment_counter([couch_log, level, alert]), - log(alert, Fmt, Args). +alert(Fmt, Args) -> log(alert, Fmt, Args). -spec emergency(string(), list()) -> ok. -emergency(Fmt, Args) -> - couch_stats:increment_counter([couch_log, level, emergency]), - log(emergency, Fmt, Args). +emergency(Fmt, Args) -> log(emergency, Fmt, Args). -spec set_level(atom() | string() | integer()) -> true. @@ -84,6 +68,7 @@ set_level(Level) -> log(Level, Fmt, Args) -> case couch_log_util:should_log(Level) of true -> + couch_stats:increment_counter([couch_log, level, Level]), Entry = couch_log_formatter:format(Level, self(), Fmt, Args), ok = couch_log_server:log(Entry); false -> |