diff options
author | Siri Hansen <[email protected]> | 2019-01-10 16:33:04 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2019-01-16 09:59:24 +0100 |
commit | 48cb63e5ba6ca42c180e6471f393254acfe322ec (patch) | |
tree | deb03f121d7b0f428461f5e6200d946cee82e7ab /lib/kernel/src/logger_config.erl | |
parent | b387ef2366f92417bcec81e461539844750fc18a (diff) | |
download | otp-48cb63e5ba6ca42c180e6471f393254acfe322ec.tar.gz otp-48cb63e5ba6ca42c180e6471f393254acfe322ec.tar.bz2 otp-48cb63e5ba6ca42c180e6471f393254acfe322ec.zip |
[logger] Store proxy config in logger ets table
This is to ensure that logger_proxy gets the same config after a
restart.
Diffstat (limited to 'lib/kernel/src/logger_config.erl')
-rw-r--r-- | lib/kernel/src/logger_config.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/kernel/src/logger_config.erl b/lib/kernel/src/logger_config.erl index 5e9faf332c..5024d20cfe 100644 --- a/lib/kernel/src/logger_config.erl +++ b/lib/kernel/src/logger_config.erl @@ -66,6 +66,8 @@ get(Tid,What) -> case ets:lookup(Tid,table_key(What)) of [{_,_,Config}] -> {ok,Config}; + [{_,Config}] when What=:=proxy -> + {ok,Config}; [] -> {error,{not_found,What}} end. @@ -79,10 +81,15 @@ get(Tid,What,Level) -> [Data] -> {ok,Data} end. +create(Tid,proxy,Config) -> + ets:insert(Tid,{table_key(proxy),Config}); create(Tid,What,Config) -> LevelInt = level_to_int(maps:get(level,Config)), ets:insert(Tid,{table_key(What),LevelInt,Config}). +set(Tid,proxy,Config) -> + ets:insert(Tid,{table_key(proxy),Config}), + ok; set(Tid,What,Config) -> LevelInt = level_to_int(maps:get(level,Config)), %% Should do this only if the level has actually changed. Possibly @@ -148,5 +155,6 @@ int_to_level(?LOG_ALL) -> all. %%%----------------------------------------------------------------- %%% Internal +table_key(proxy) -> ?PROXY_KEY; table_key(primary) -> ?PRIMARY_KEY; table_key(HandlerId) -> {?HANDLER_KEY,HandlerId}. |