Add missing options of ejabberd_logger to validator

This commit is contained in:
Evgeniy Khramtsov 2015-06-03 15:25:20 +03:00
parent 83faff37e5
commit 0ae9ef2b41
1 changed files with 14 additions and 1 deletions

View File

@ -25,8 +25,10 @@
%%%-------------------------------------------------------------------
-module(ejabberd_logger).
-behaviour(ejabberd_config).
%% API
-export([start/0, reopen_log/0, get/0, set/1, get_log_path/0]).
-export([start/0, reopen_log/0, get/0, set/1, get_log_path/0, opt_type/1].
-include("ejabberd.hrl").
@ -184,6 +186,17 @@ get() ->
set(LogLevel) ->
p1_loglevel:set(LogLevel).
opt_type(log_rotate_date) ->
fun(S) -> binary_to_list(iolist_to_binary(S)) end;
opt_type(log_rotate_size) ->
fun(I) when is_integer(I), I >= 0 -> I end;
opt_type(log_rotate_count) ->
fun(I) when is_integer(I), I >= 0 -> I end;
opt_type(log_rate_limit) ->
fun(I) when is_integer(I), I >= 0 -> I end;
opt_type(_) ->
[log_rotate_date, log_rotate_size, log_rotate_count, log_rate_limit].
%%%===================================================================
%%% Internal functions
%%%===================================================================