221V 3 лет назад
Родитель
Сommit
fbc57bb7fd
4 измененных файлов с 24 добавлено и 20 удалено
  1. 1 1
      ebin/n4u.app
  2. 0 16
      src/handlers/n2o_log.erl
  3. 20 0
      src/handlers/n4u_log.erl
  4. 3 3
      src/wf.erl

+ 1 - 1
ebin/n4u.app

@@ -2,7 +2,7 @@
   {description, "N4U WebSocket Application Server"},
   {vsn, "4.4.20"},
   {applications, [kernel, stdlib, asn1, public_key, ssl, crypto, ranch, cowboy, fs, active, sh, gproc, nitro]},
-  {modules, [n2o, n4u_app, n4u_sup, n4u_async, n2o_xhr, n4u_cx, n2o_cowboy, n2o_multipart, n2o_static, n2o_stream, n4u_document, n2o_proto, n2o_relay, n4u_error, n4u_io, n2o_log, n2o_mq, n2o_pickle, n2o_query, n2o_secret, n2o_session, n2o_syn, n4u_client, n2o_file, n4u_heart, n4u_http, n2o_nitrogen, n2o_text, wf, wf_convert, wf_utils]},
+  {modules, [n2o, n4u_app, n4u_sup, n4u_async, n2o_xhr, n4u_cx, n2o_cowboy, n2o_multipart, n2o_static, n2o_stream, n4u_document, n2o_proto, n2o_relay, n4u_error, n4u_io, n4u_log, n2o_mq, n2o_pickle, n2o_query, n2o_secret, n2o_session, n2o_syn, n4u_client, n2o_file, n4u_heart, n4u_http, n2o_nitrogen, n2o_text, wf, wf_convert, wf_utils]},
   {registered, [n4u_sup]},
   {mod, {n4u_app, []}},
   {env, []}

+ 0 - 16
src/handlers/n2o_log.erl

@@ -1,16 +0,0 @@
--module(n2o_log).
--export([info/3, warning/3, error/3]).
-
-
-info(Module, String, Args) ->
-    error_logger:info_msg(format_message(Module, String), Args).
-
-warning(Module, String, Args) ->
-    error_logger:warning_msg(format_message(Module, String), Args).
-
-error(Module, String, Args) ->
-    error_logger:error_msg(format_message(Module, String), Args).
-
-
-format_message(Module, String) ->
-    wf:to_list([Module, ":", String, "~n"]).

+ 20 - 0
src/handlers/n4u_log.erl

@@ -0,0 +1,20 @@
+-module(n4u_log).
+
+-export([info/3, warning/3, error/3]).
+
+
+info(Module, String, Args) ->
+  error_logger:info_msg(format_message(Module, String), Args).
+
+
+warning(Module, String, Args) ->
+  error_logger:warning_msg(format_message(Module, String), Args).
+
+
+error(Module, String, Args) ->
+  error_logger:error_msg(format_message(Module, String), Args).
+
+
+format_message(Module, String) ->
+  nitro:to_list([Module, ":", String, "~n"]).
+

+ 3 - 3
src/wf.erl

@@ -177,11 +177,11 @@ reply(Status,Req) -> ?BRIDGE:reply(Status,Req).
 
 % Logging API
 
--define(LOGGER, (wf:config(n2o,log_backend,n2o_log))).
+-define(LOGGER, (wf:config(n4u, log_backend, n4u_log))).
 log_modules() -> [wf].
 log_level() -> info.
--define(LOG_MODULES, (wf:config(n2o,log_modules,wf))).
--define(LOG_LEVEL, (wf:config(n2o,log_level,wf))).
+-define(LOG_MODULES, (wf:config(n4u, log_modules, wf))).
+-define(LOG_LEVEL, (wf:config(n4u, log_level, wf))).
 
 log_level(none) -> 3;
 log_level(error) -> 2;