diff options
author | Siri Hansen <[email protected]> | 2018-06-18 17:37:27 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2018-07-13 12:20:25 +0200 |
commit | 8fed5e01980996cd34be6e27370eed74b5c0ed5d (patch) | |
tree | f3b9d741ea4b30029c46b2016677a742604c6575 /lib/kernel/src/logger.erl | |
parent | 308e7677170d56c4270d82af1a37375038da5d72 (diff) | |
download | otp-8fed5e01980996cd34be6e27370eed74b5c0ed5d.tar.gz otp-8fed5e01980996cd34be6e27370eed74b5c0ed5d.tar.bz2 otp-8fed5e01980996cd34be6e27370eed74b5c0ed5d.zip |
[logger] Improve spec for set_handler_config/3 and set_primary_config/2
Specify which keys and associated values are allowed.
Diffstat (limited to 'lib/kernel/src/logger.erl')
-rw-r--r-- | lib/kernel/src/logger.erl | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl index 0a9b1672ec..c78f5372f0 100644 --- a/lib/kernel/src/logger.erl +++ b/lib/kernel/src/logger.erl @@ -352,9 +352,12 @@ add_handler(HandlerId,Module,Config) -> remove_handler(HandlerId) -> logger_server:remove_handler(HandlerId). --spec set_primary_config(Key,Value) -> ok | {error,term()} when - Key :: atom(), - Value :: term(). +-spec set_primary_config(level,Level) -> ok | {error,term()} when + Level :: level() | all | none; + (filter_default,FilterDefault) -> ok | {error,term()} when + FilterDefault :: log | stop; + (filters,Filters) -> ok | {error,term()} when + Filters :: [{filter_id(),filter()}]. set_primary_config(Key,Value) -> logger_server:set_config(primary,Key,Value). @@ -363,10 +366,26 @@ set_primary_config(Key,Value) -> set_primary_config(Config) -> logger_server:set_config(primary,Config). --spec set_handler_config(HandlerId,Key,Value) -> ok | {error,term()} when +-spec set_handler_config(HandlerId,level,Level) -> Return when HandlerId :: handler_id(), - Key :: atom(), - Value :: term(). + Level :: level() | all | none, + Return :: ok | {error,term()}; + (HandlerId,filter_default,FilterDefault) -> Return when + HandlerId :: handler_id(), + FilterDefault :: log | stop, + Return :: ok | {error,term()}; + (HandlerId,filters,Filters) -> Return when + HandlerId :: handler_id(), + Filters :: [{filter_id(),filter()}], + Return :: ok | {error,term()}; + (HandlerId,formatter,Formatter) -> Return when + HandlerId :: handler_id(), + Formatter :: {module(), formatter_config()}, + Return :: ok | {error,term()}; + (HandlerId,config,Config) -> Return when + HandlerId :: handler_id(), + Config :: term(), + Return :: ok | {error,term()}. set_handler_config(HandlerId,Key,Value) -> logger_server:set_config(HandlerId,Key,Value). |