Browse Source

ft:修改

master
SisMaker 4 years ago
parent
commit
5e45b51572
7 changed files with 28 additions and 60 deletions
  1. +1
    -17
      src/backend/rumBackendConsole.erl
  2. +1
    -1
      src/backend/rumBackendFile.erl
  3. +1
    -1
      src/eRum.app.src
  4. +1
    -1
      src/eRum_app.erl
  5. +0
    -39
      src/watcher/rumHandlerWatcherSup.erl
  6. +1
    -1
      src/watcher/rumHleWatcherSrv.erl
  7. +23
    -0
      src/watcher/rumHleWatcherSup.erl

src/backend/rumConsoleBackend.erl → src/backend/rumBackendConsole.erl View File

@ -1,19 +1,3 @@
%% Copyright (c) 2011-2012, 2014 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing,
%% software distributed under the License is distributed on an
%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
%% KIND, either express or implied. See the License for the
%% specific language governing permissions and limitations
%% under the License.
%% @doc Console backend for lager. %% @doc Console backend for lager.
%% Configuration is a proplist with the following keys: %% Configuration is a proplist with the following keys:
%% <ul> %% <ul>
@ -26,7 +10,7 @@
%% `time [ severity ] message'</li> %% `time [ severity ] message'</li>
%% </ul> %% </ul>
-module(rumConsoleBackend).
-module(rumBackendConsole).
-behaviour(gen_event). -behaviour(gen_event).

src/backend/rumFileBackend.erl → src/backend/rumBackendFile.erl View File

@ -12,7 +12,7 @@
%% sync at specific log levels, configured via the `sync_on' option. By default %% sync at specific log levels, configured via the `sync_on' option. By default
%% the error level or above will trigger a sync. %% the error level or above will trigger a sync.
-module(rumFileBackend).
-module(rumBackendFile).
-include("rum.hrl"). -include("rum.hrl").
-include_lib("kernel/include/file.hrl"). -include_lib("kernel/include/file.hrl").

+ 1
- 1
src/eRum.app.src View File

@ -4,7 +4,7 @@
{vsn, "0.1.0"}, {vsn, "0.1.0"},
{modules, []}, {modules, []},
{applications, [kernel, stdlib, goldrush]}, {applications, [kernel, stdlib, goldrush]},
{registered, [eRum_sup, lager_event, rumCrashLog, rumHandlerWatcherSup]},
{registered, [eRum_sup, lager_event, rumCrashLog, rumHleWatcherSup]},
{mod, {eRum_app, []}}, {mod, {eRum_app, []}},
{env, [ {env, [
%% Note: application:start(lager) overwrites previously defined environment variables thus declaration of default handlers is done at lager_app.erl %% Note: application:start(lager) overwrites previously defined environment variables thus declaration of default handlers is done at lager_app.erl

+ 1
- 1
src/eRum_app.erl View File

@ -238,7 +238,7 @@ expand_handlers([{lager_file_backend, [{Key, _Value} | _] = Config} | T]) when i
[maybe_make_handler_id(lager_file_backend, Config) | expand_handlers(T)]; [maybe_make_handler_id(lager_file_backend, Config) | expand_handlers(T)];
expand_handlers([{lager_file_backend, Configs} | T]) -> expand_handlers([{lager_file_backend, Configs} | T]) ->
?INT_LOG(notice, "Deprecated lager_file_backend config detected, please consider updating it", []), ?INT_LOG(notice, "Deprecated lager_file_backend config detected, please consider updating it", []),
[{rumFileBackend:config_to_id(Config), Config} || Config <- Configs] ++
[{rumBackendFile:config_to_id(Config), Config} || Config <- Configs] ++
expand_handlers(T); expand_handlers(T);
expand_handlers([{Mod, Config} | T]) when is_atom(Mod) -> expand_handlers([{Mod, Config} | T]) when is_atom(Mod) ->
[maybe_make_handler_id(Mod, Config) | expand_handlers(T)]; [maybe_make_handler_id(Mod, Config) | expand_handlers(T)];

+ 0
- 39
src/watcher/rumHandlerWatcherSup.erl View File

@ -1,39 +0,0 @@
%% Copyright (c) 2011-2012 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing,
%% software distributed under the License is distributed on an
%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
%% KIND, either express or implied. See the License for the
%% specific language governing permissions and limitations
%% under the License.
%% @doc A supervisor for monitoring lager_handler_watcher processes.
%% @private
-module(rumHandlerWatcherSup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Callbacks
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok, {{simple_one_for_one, 10, 60},
[
{lager_handler_watcher, {lager_handler_watcher, start_link, []},
temporary, 5000, worker, [lager_handler_watcher]}
]}}.

src/watcher/rumHandlerWatcherSrv.erl → src/watcher/rumHleWatcherSrv.erl View File

@ -19,7 +19,7 @@
%% @private %% @private
-module(rumHandlerWatcherSrv).
-module(rumHleWatcherSrv).
-behaviour(gen_server). -behaviour(gen_server).

+ 23
- 0
src/watcher/rumHleWatcherSup.erl View File

@ -0,0 +1,23 @@
%% @doc A supervisor for monitoring lager_handler_watcher processes.
%% @private
-module(rumHleWatcherSup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Callbacks
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok, {{simple_one_for_one, 10, 60},
[
{lager_handler_watcher, {lager_handler_watcher, start_link, []},
temporary, 5000, worker, [lager_handler_watcher]}
]}}.

Loading…
Cancel
Save