Permalink
Browse files

Merge branch 'KAZOO-797'

Conflicts:
	.gitignore
	ecallmgr/Makefile
	lib/whistle-1.0.0/Makefile
	lib/whistle_number_manager-1.0.0/Makefile
	whistle_apps/apps/pivot/Makefile
	whistle_apps/apps/reorder/rebar.config
	whistle_apps/lib/kazoo_translator-1.0.0/Makefile
  • Loading branch information...
k-anderson committed Apr 8, 2013
2 parents ab89e93 + f2e679d commit 264bdf5122a9e526d5ec4fb938fbbb6a6e11f010
Showing with 5,659 additions and 4,881 deletions.
  1. +15 −12 .gitignore
  2. +1 −1 Makefile
  3. +1 −2 ecallmgr/Makefile
  4. +2 −13 ecallmgr/src/ecallmgr.app.src
  5. +1 −1 ecallmgr/src/ecallmgr.hrl
  6. +13 −13 ecallmgr/src/ecallmgr_config.erl
  7. +4 −1 ecallmgr/src/ecallmgr_init.erl
  8. +0 −1 lib/basho-lager_syslog/deps/lager
  9. 0 lib/basho-lager_syslog/ebin/.placeholder
  10. +0 −9 lib/basho-lager_syslog/rebar.config
  11. +0 −85 lib/basho-lager_syslog/src/lager_syslog_backend.erl
  12. +108 −0 lib/erlang-syslog-1.0.1/README.md
  13. +251 −0 lib/erlang-syslog-1.0.1/c_src/syslog_drv.c
  14. +2 −2 lib/{syslog-0.0.1 → erlang-syslog-1.0.1}/src/syslog.app.src
  15. +264 −0 lib/erlang-syslog-1.0.1/src/syslog.erl
  16. 0 lib/{syslog-0.0.1 → erlang-syslog-1.0.1}/src/syslog_app.erl
  17. +1 −2 lib/{syslog-0.0.1 → erlang-syslog-1.0.1}/src/syslog_sup.erl
  18. 0 lib/lager-1.0.0/ebin/.placeholder
  19. +0 −42 lib/lager-1.0.0/src/lager.app.src
  20. +0 −301 lib/lager-1.0.0/src/lager.erl
  21. +0 −83 lib/lager-1.0.0/src/lager_app.erl
  22. +0 −273 lib/lager-1.0.0/src/lager_console_backend.erl
  23. +0 −394 lib/lager-1.0.0/src/lager_file_backend.erl
  24. +0 −107 lib/lager-1.0.0/src/lager_mochiglobal.erl
  25. +0 −132 lib/lager-1.0.0/src/lager_transform.erl
  26. +0 −137 lib/lager-1.0.0/src/switchblade_transform.erl
  27. +0 −104 lib/lager-1.0.0/test/crash.erl
  28. +0 −68 lib/lager-1.0.0/test/lager_crash_backend.erl
  29. +0 −801 lib/lager-1.0.0/test/lager_test_backend.erl
  30. +0 −36 lib/lager-1.0.0/test/special_process.erl
  31. +0 −89 lib/lager-1.0.0/test/sync_error_logger.erl
  32. +0 −208 lib/lager-1.0.0/test/trunc_io_eqc.erl
  33. +8 −0 lib/lager-2.0.0rc1/.gitignore
  34. +11 −0 lib/lager-2.0.0rc1/.travis.yml
  35. 0 lib/{lager-1.0.0 → lager-2.0.0rc1}/LICENSE
  36. +9 −12 lib/{lager-1.0.0 → lager-2.0.0rc1}/Makefile
  37. +80 −4 lib/{lager-1.0.0 → lager-2.0.0rc1}/README.org
  38. 0 lib/{lager-1.0.0 → lager-2.0.0rc1}/TODO
  39. 0 lib/{lager-1.0.0 → lager-2.0.0rc1}/dialyzer.ignore-warnings
  40. +20 −14 lib/{lager-1.0.0 → lager-2.0.0rc1}/include/lager.hrl
  41. +130 −0 lib/lager-2.0.0rc1/priv/edoc.css
  42. BIN lib/lager-2.0.0rc1/rebar
  43. +1 −0 lib/{lager-1.0.0 → lager-2.0.0rc1}/rebar.config
  44. +161 −41 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/error_logger_lager_h.erl
  45. +54 −0 lib/lager-2.0.0rc1/src/lager.app.src
  46. +365 −0 lib/lager-2.0.0rc1/src/lager.erl
  47. +197 −0 lib/lager-2.0.0rc1/src/lager_app.erl
  48. +77 −0 lib/lager-2.0.0rc1/src/lager_backend_throttle.erl
  49. +64 −0 lib/lager-2.0.0rc1/src/lager_config.erl
  50. +383 −0 lib/lager-2.0.0rc1/src/lager_console_backend.erl
  51. +5 −7 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/lager_crash_log.erl
  52. +189 −0 lib/lager-2.0.0rc1/src/lager_default_formatter.erl
  53. +692 −0 lib/lager-2.0.0rc1/src/lager_file_backend.erl
  54. +82 −72 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/lager_format.erl
  55. +5 −8 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/lager_handler_watcher.erl
  56. +1 −1 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/lager_handler_watcher_sup.erl
  57. +192 −0 lib/lager-2.0.0rc1/src/lager_kazoo_formatter.erl
  58. +64 −0 lib/lager-2.0.0rc1/src/lager_msg.erl
  59. 0 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/lager_stdlib.erl
  60. +5 −1 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/lager_sup.erl
  61. +275 −0 lib/lager-2.0.0rc1/src/lager_transform.erl
  62. +243 −57 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/lager_trunc_io.erl
  63. +247 −63 lib/{lager-1.0.0 → lager-2.0.0rc1}/src/lager_util.erl
  64. +0 −1 lib/lager_syslog-0.9.0
  65. +2 −0 lib/lager_syslog-1.2.2/.gitignore
  66. +9 −0 lib/lager_syslog-1.2.2/.travis.yml
  67. +7 −10 lib/{basho-lager_syslog → lager_syslog-1.2.2}/Makefile
  68. +12 −0 lib/{basho-lager_syslog → lager_syslog-1.2.2}/README.org
  69. BIN lib/lager_syslog-1.2.2/rebar
  70. +9 −0 lib/lager_syslog-1.2.2/rebar.config
  71. +1 −1 lib/{basho-lager_syslog → lager_syslog-1.2.2}/src/lager_syslog.app.src
  72. +141 −0 lib/lager_syslog-1.2.2/src/lager_syslog_backend.erl
  73. +2 −2 lib/rebar.config
  74. +0 −19 lib/syslog-0.0.1/Makefile
  75. +0 −91 lib/syslog-0.0.1/README.md
  76. +0 −180 lib/syslog-0.0.1/c_src/syslog_drv.c
  77. 0 lib/syslog-0.0.1/ebin/.placeholder
  78. 0 lib/syslog-0.0.1/priv/.placeholder
  79. +0 −1 lib/syslog-0.0.1/rebar.config
  80. +0 −200 lib/syslog-0.0.1/src/syslog.erl
  81. +2 −3 lib/whistle-1.0.0/Makefile
  82. +2 −2 lib/whistle-1.0.0/include/wh_log.hrl
  83. +0 −4 lib/whistle-1.0.0/rebar.config
  84. +0 −137 lib/whistle-1.0.0/src/switchblade_transform.erl
  85. +3 −3 lib/whistle-1.0.0/src/wh_util.erl
  86. +39 −22 lib/whistle_amqp-1.0.0/Makefile
  87. +0 −5 lib/whistle_amqp-1.0.0/rebar.config
  88. +1 −1 lib/whistle_config-1.0.0/Makefile
  89. +0 −6 lib/whistle_config-1.0.0/rebar.config
  90. +1 −2 lib/whistle_number_manager-1.0.0/Makefile
  91. +0 −4 lib/whistle_number_manager-1.0.0/rebar.config
  92. +41 −21 lib/whistle_stats-1.0.0/Makefile
  93. +0 −4 lib/whistle_stats-1.0.0/rebar.config
  94. +39 −24 lib/whistle_transactions-1.0.0/Makefile
  95. +0 −6 lib/whistle_transactions-1.0.0/rebar.config
  96. +55 −0 utils/lineman/Makefile
  97. +0 −4 utils/lineman/rebar.config
  98. +2 −5 utils/lineman/src/lineman.hrl
  99. +5 −2 utils/lineman/src/lineman_bindings.erl
  100. +5 −5 utils/lineman/src/lineman_sequence.erl
  101. +4 −4 utils/lineman/src/lineman_toolbag_sup.erl
  102. +29 −29 utils/lineman/src/lineman_util.erl
  103. +2 −2 utils/lineman/src/lineman_worker.erl
  104. +5 −5 utils/lineman/src/lineman_workorder.erl
  105. +15 −16 whistle_apps/apps/acdc/Makefile
  106. +0 −6 whistle_apps/apps/acdc/rebar.config
  107. +14 −16 whistle_apps/apps/callflow/Makefile
  108. +0 −6 whistle_apps/apps/callflow/rebar.config
  109. +14 −16 whistle_apps/apps/cdr/Makefile
  110. +0 −6 whistle_apps/apps/cdr/rebar.config
  111. +14 −16 whistle_apps/apps/conference/Makefile
  112. +0 −5 whistle_apps/apps/conference/rebar.config
  113. +15 −17 whistle_apps/apps/crossbar/Makefile
  114. +0 −6 whistle_apps/apps/crossbar/rebar.config
  115. +46 −26 whistle_apps/apps/dth/Makefile
  116. +0 −6 whistle_apps/apps/dth/rebar.config
  117. +1 −1 whistle_apps/apps/dth/src/dth_blacklist_req.erl
  118. +1 −1 whistle_apps/apps/dth/src/dth_listener.erl
  119. +1 −1 whistle_apps/apps/dth/src/dth_sup.erl
  120. +46 −26 whistle_apps/apps/fax/Makefile
  121. +0 −7 whistle_apps/apps/fax/rebar.config
  122. +1 −2 whistle_apps/apps/fax/src/fax.erl
  123. +46 −26 whistle_apps/apps/hangups/Makefile
  124. +0 −6 whistle_apps/apps/hangups/rebar.config
  125. +46 −26 whistle_apps/apps/hotornot/Makefile
  126. +0 −6 whistle_apps/apps/hotornot/rebar.config
  127. +46 −27 whistle_apps/apps/jonny5/Makefile
  128. +0 −6 whistle_apps/apps/jonny5/rebar.config
  129. +46 −26 whistle_apps/apps/media_mgr/Makefile
  130. +0 −6 whistle_apps/apps/media_mgr/rebar.config
  131. +46 −26 whistle_apps/apps/notify/Makefile
  132. +0 −6 whistle_apps/apps/notify/rebar.config
  133. +15 −17 whistle_apps/apps/pivot/Makefile
  134. +0 −7 whistle_apps/apps/pivot/rebar.config
  135. +0 −6 whistle_apps/apps/promocalling/rebar.config
  136. +0 −12 whistle_apps/apps/promocalling/src/promocalling.app.src
  137. +0 −48 whistle_apps/apps/promocalling/src/promocalling.erl
  138. +0 −21 whistle_apps/apps/promocalling/src/promocalling_app.erl
  139. +0 −29 whistle_apps/apps/promocalling/src/promocalling_sup.erl
  140. +46 −26 whistle_apps/apps/registrar/Makefile
  141. +0 −6 whistle_apps/apps/registrar/rebar.config
  142. +46 −26 whistle_apps/apps/reorder/Makefile
  143. +46 −26 whistle_apps/apps/skel/Makefile
  144. +0 −6 whistle_apps/apps/skel/rebar.config
  145. +46 −26 whistle_apps/apps/spyvsspy/Makefile
  146. +0 −6 whistle_apps/apps/spyvsspy/rebar.config
  147. +14 −12 whistle_apps/apps/stepswitch/Makefile
  148. +0 −4 whistle_apps/apps/stepswitch/rebar.config
  149. +46 −26 whistle_apps/apps/sysconf/Makefile
  150. +0 −6 whistle_apps/apps/sysconf/rebar.config
  151. +46 −26 whistle_apps/apps/trunkstore/Makefile
  152. +0 −5 whistle_apps/apps/trunkstore/rebar.config
  153. +43 −24 whistle_apps/lib/braintree-1.0.0/Makefile
  154. +0 −6 whistle_apps/lib/braintree-1.0.0/rebar.config
  155. +45 −30 whistle_apps/lib/couchbeam-0.8.0/Makefile
  156. +0 −1 whistle_apps/lib/couchbeam-0.8.0/rebar
  157. +0 −25 whistle_apps/lib/couchbeam-0.8.0/rebar.config
  158. +1 −1 whistle_apps/lib/couchbeam-0.8.0/src/couchbeam.erl
  159. +1 −1 whistle_apps/lib/couchbeam-0.8.0/src/couchbeam_attachments.erl
  160. +1 −1 whistle_apps/lib/couchbeam-0.8.0/src/couchbeam_changes.erl
  161. +1 −1 whistle_apps/lib/couchbeam-0.8.0/src/couchbeam_doc.erl
  162. +0 −1 whistle_apps/lib/couchbeam-0.8.0/src/couchbeam_json_stream.erl
  163. +1 −2 whistle_apps/lib/couchbeam-0.8.0/src/couchbeam_uuids.erl
  164. +1 −2 whistle_apps/lib/couchbeam-0.8.0/src/couchbeam_view.erl
  165. +1 −1 whistle_apps/lib/couchbeam-0.8.0/src/gen_changes.erl
  166. +51 −4 whistle_apps/lib/detergent-0.2/Makefile
  167. +0 −6 whistle_apps/lib/detergent-0.2/rebar.config
  168. +1 −1 whistle_apps/lib/detergent-0.2/src/detergent.erl
  169. +1 −1 whistle_apps/lib/detergent-0.2/src/detergent_server.erl
  170. +4 −5 whistle_apps/lib/kazoo_translator-1.0.0/Makefile
  171. +0 −4 whistle_apps/lib/kazoo_translator-1.0.0/rebar.config
  172. +14 −14 whistle_apps/lib/whistle_couch-1.0.0/Makefile
  173. +0 −5 whistle_apps/lib/whistle_couch-1.0.0/rebar.config
  174. +44 −24 whistle_apps/lib/whistle_media-1.0.0/Makefile
  175. +0 −6 whistle_apps/lib/whistle_media-1.0.0/rebar.config
  176. +46 −24 whistle_apps/lib/whistle_services-1.0.0/Makefile
  177. +0 −6 whistle_apps/lib/whistle_services-1.0.0/rebar.config
  178. +59 −0 whistle_apps/templates/Makefile.whapp.sample
  179. +0 −1 whistle_apps/templates/rebar.config
View
@@ -3,8 +3,14 @@
*.sasl
*/ebin/*.beam
*/ebin/*.app
-ecallmgr/test
-whistle_apps/apps/*/test
+*/deps/*/ebin/*.beam
+*/ebin/*.app
+*/priv/*.pid
+.eunit
+.*_dialyzer.plt
+#*
+.#*
+lib/*/test
lib/*/test/*.beam
lib/*/test/*.app
lib/*/ebin/*.beam
@@ -26,23 +32,20 @@ whistle_apps/lib/*/deps/*/ebin/*.app
whistle_apps/lib/*/test/*
whistle_apps/lib/*/dist/*
whistle_apps/lib/erlydtl-0.7.0/src/erlydtl_parser.erl
-*/deps/*/ebin/*.beam
-*/ebin/*.app
-*/priv/*.pid
-.eunit
-ecallmgr/priv/startup.config
-ecallmgr/deps/lager-1.0.0/ebin/*
-ecallmgr/*crash.dump
+whistle_apps/test
+whistle_apps/lib/*/test
whistle_apps/priv/startup.config
+whistle_apps/apps/*/test
whistle_apps/apps/*/ebin/*.beam
whistle_apps/apps/*/ebin/*.app
whistle_apps/apps/crossbar/priv/ssl/*
whistle_apps/deps/lager-1.0.0/ebin/*
whistle_apps/*crash.dump
+ecallmgr/priv/startup.config
+ecallmgr/deps/lager-1.0.0/ebin/*
+ecallmgr/*crash.dump
+ecallmgr/test
utils/*/ebin/*.beam
utils/*/ebin/*.app
-.*_dialyzer.plt
-#*
-.#*
/utils/sup/deps/getopt/
/lib/rabbitmq_server-2.8.6/deps.mk
View
@@ -4,7 +4,7 @@ REBAR = $(ROOT)/bin/rebar
MAKEDIRS = lib/rabbitmq_server-2.8.6/Makefile \
lib/rabbitmq_client-2.8.6/Makefile \
- lib/lager-1.0.0/Makefile \
+ lib/lager-2.0.0rc1/Makefile \
lib/*/Makefile \
ecallmgr/Makefile \
whistle_apps/Makefile
View
@@ -40,10 +40,9 @@ test/$(PROJECT).app: src/*.erl
clean:
rm -f ebin/*
- rm -f test/*.*
+ rm -f test/*.beam test/$(PROJECT).app
rm -f erl_crash.dump
-
test: clean compile-test eunit
eunit: compile-test
@@ -12,20 +12,9 @@
,{included_applications, [
crypto
,sasl
+ ,lager
,whistle_amqp
]}
,{mod, {ecallmgr_app, []}}
- ,{env, [{reloader, false}
- ,{lager, [
- {handlers, [
- {lager_console_backend, debug}
- ,{lager_file_backend, [
- {"debug.log", debug, 10485760, "$D0", 5}
- ,{"error.log", error, 10485760, "$D0", 5}
- ]}
- ,{lager_syslog_backend, ["ecallmgr", local0, debug]}
- ]}
- ]
- }
- ]}
+ ,{env, [{reloader, false}]}
]}.
@@ -1,6 +1,6 @@
-ifndef(ECALLMGR_HRL).
--compile([{parse_transform, switchblade_transform}]).
+-compile([{'parse_transform', 'lager_transform'}]).
-include_lib("whistle/include/wh_types.hrl").
-include_lib("whistle/include/wh_amqp.hrl").
@@ -14,7 +14,7 @@
-export([fetch/1, fetch/2, fetch/3]).
-export([set/2, set/3]).
--compile([{no_auto_import, [get/1]}]).
+-compile([{'no_auto_import', [get/1]}]).
-include("ecallmgr.hrl").
-include_lib("whistle/include/wh_databases.hrl").
@@ -52,7 +52,7 @@ flush(Key, Node) ->
-spec get(wh_json:json_string(), Default, wh_json:json_string() | atom()) -> wh_json:json_term() | Default.
get(Key) ->
- get(Key, undefined).
+ get(Key, 'undefined').
get(Key, Default) ->
get(Key, Default, wh_util:to_binary(node())).
@@ -63,10 +63,10 @@ get(Key, Default, Node) when not is_binary(Node) ->
get(Key, Default, wh_util:to_binary(Node));
get(Key, Default, Node) ->
case wh_cache:fetch_local(?ECALLMGR_UTIL_CACHE, cache_key(Key, Node)) of
- {ok, V} -> V;
- {error, E} when E =:= not_found orelse E =:= undefined ->
+ {'ok', V} -> V;
+ {'error', E} when E =:= 'not_found' orelse E =:= 'undefined' ->
Value = fetch(Key, Default, Node),
- CacheProps = [{origin, {db, ?WH_CONFIG_DB, <<"ecallmgr">>}}],
+ CacheProps = [{'origin', {'db', ?WH_CONFIG_DB, <<"ecallmgr">>}}],
wh_cache:store_local(?ECALLMGR_UTIL_CACHE, cache_key(Key, Node), Value, CacheProps),
Value
end.
@@ -76,7 +76,7 @@ get(Key, Default, Node) ->
-spec fetch(wh_json:json_string(), Default, wh_json:json_string() | atom()) -> wh_json:json_term() | Default.
fetch(Key) ->
- fetch(Key, undefined).
+ fetch(Key, 'undefined').
fetch(Key, Default) ->
fetch(Key, Default, wh_util:to_binary(node())).
@@ -100,10 +100,10 @@ fetch(Key, Default, Node) ->
,fun wapi_sysconf:get_resp_v/1
),
case ReqResp of
- {error, _R} ->
+ {'error', _R} ->
lager:debug("unable to get config for key '~s' failed: ~p", [Key, _R]),
Default;
- {ok, JObj} ->
+ {'ok', JObj} ->
get_response_value(JObj, Default)
end.
@@ -118,7 +118,7 @@ set(Key, Value, Node) when not is_binary(Key) ->
set(Key, Value, Node) when not is_binary(Node) ->
set(Key, Value, wh_util:to_binary(Node));
set(Key, Value, Node) ->
- CacheProps = [{origin, {db, ?WH_CONFIG_DB, <<"ecallmgr">>}}],
+ CacheProps = [{'origin', {'db', ?WH_CONFIG_DB, <<"ecallmgr">>}}],
wh_cache:store_local(?ECALLMGR_UTIL_CACHE, cache_key(Key, Node), Value, CacheProps),
Req = [{<<"Category">>, <<"ecallmgr">>}
,{<<"Key">>, Key}
@@ -131,17 +131,17 @@ set(Key, Value, Node) ->
,fun wapi_sysconf:publish_set_req/1
,fun wh_amqp_worker:any_resp/1),
case ReqResp of
- {error, _R} ->
+ {'error', _R} ->
lager:debug("set config for key '~s' failed: ~p", [Key, _R]);
- {ok, _} ->
+ {'ok', _} ->
lager:debug("set config for key '~s' to new value: ~p", [Key, Value])
end.
-spec get_response_value(wh_json:json_object(), term()) -> term().
get_response_value(JObj, Default) ->
case wh_json:get_value(<<"Value">>, JObj) of
- undefined -> Default;
- null -> Default;
+ 'undefined' -> Default;
+ 'null' -> Default;
<<"undefined">> -> Default;
<<"null">> -> Default;
Value -> Value
@@ -34,7 +34,10 @@ start_link() -> spawn(?MODULE, 'init', []), 'ignore'.
init() ->
put('callid', ?MODULE),
- set_loglevel().
+ set_loglevel(),
+
+ %% ecallmgr may be the first to start up, and it starts publishing here
+ amqp_util:sysconf_exchange().
set_loglevel() ->
[Console|_] = wh_config:get_atom('log', 'console', 'notice'),
Submodule lager deleted from b46e37
No changes.
@@ -1,9 +0,0 @@
-{erl_opts, [debug_info]}.
-{lib_dirs, ["../"]}.
-{cover_enabled, true}.
-{deps, [
- %% {lager, "0.9.*", {git, "git://github.com/basho/lager", {branch, "master"}}},
- %% {'syslog', "0.0.1", {git, "git://github.com/Vagabond/erlang-syslog", {branch, "master"}}}
- ]
-}.
-
@@ -1,85 +0,0 @@
-%% Copyright (c) 2011 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 Syslog backend for lager.
-
--module(lager_syslog_backend).
-
--behaviour(gen_event).
-
--export([init/1, handle_call/2, handle_event/2, handle_info/2, terminate/2,
- code_change/3]).
-
--record(state, {level}).
-
--include_lib("lager/include/lager.hrl").
-
-%% @private
-init([Ident, Facility, Level]) ->
- case application:start(syslog) of
- ok ->
- init2(Ident, Facility, Level);
- {error, {already_started, _}} ->
- init2(Ident, Facility, Level);
- Error ->
- Error
- end.
-
-init2(Ident, Facility, Level) ->
- case syslog:open(Ident, [pid], Facility) of
- ok ->
- {ok, #state{level=lager_util:level_to_num(Level)}};
- Error ->
- Error
- end.
-
-%% @private
-handle_call(get_loglevel, #state{level=Level} = State) ->
- {ok, Level, State};
-handle_call({set_loglevel, Level}, State) ->
- {ok, ok, State#state{level=lager_util:level_to_num(Level)}};
-handle_call(_Request, State) ->
- {ok, ok, State}.
-
-%% @private
-handle_event({log, Level, {_Date, _Time}, [_LevelStr, Location, Message]}, State) ->
- syslog:log(convert_level(Level), [Location, Message]),
- {ok, State};
-handle_event(_Event, State) ->
- {ok, State}.
-
-%% @private
-handle_info(_Info, State) ->
- {ok, State}.
-
-%% @private
-terminate(_Reason, _State) ->
- application:stop(syslog),
- ok.
-
-%% @private
-code_change(_OldVsn, State, _Extra) ->
- {ok, State}.
-
-convert_level(?DEBUG) -> debug;
-convert_level(?INFO) -> info;
-convert_level(?NOTICE) -> notice;
-convert_level(?WARNING) -> warning;
-convert_level(?ERROR) -> err;
-convert_level(?CRITICAL) -> crit;
-convert_level(?ALERT) -> alert;
-convert_level(?EMERGENCY) -> emergency.
-
Oops, something went wrong.

0 comments on commit 264bdf5

Please sign in to comment.