Skip to content

Commit abd2b35

Browse files
author
José Valim
committed
Get rid of Logger timeout config, closes #2724
1 parent 2afb875 commit abd2b35

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

lib/logger/lib/logger.ex

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ defmodule Logger do
6767
cause the message to be ignored. Keep in mind that each backend
6868
may have its specific level, too.
6969
70-
* `:timeout` - the timeout for sync requests in miliseconds, defaults
71-
to 5000 miliseconds.
72-
7370
* `:utc_log` - when `true`, uses UTC in logs. By default it uses
7471
local time (i.e. it defaults to `false`).
7572
@@ -369,16 +366,16 @@ defmodule Logger do
369366
or you want to explicitly avoid embedding metadata.
370367
"""
371368
@spec log(level, message | (() -> message), Keyword.t) ::
372-
:ok | {:error, :noproc} | {:error, :timeout} | {:error, term}
369+
:ok | {:error, :noproc} | {:error, term}
373370
def log(level, chardata, metadata \\ []) when level in @levels and is_list(metadata) do
374-
%{mode: mode, truncate: truncate, timeout: timeout,
371+
%{mode: mode, truncate: truncate,
375372
level: min_level, utc_log: utc_log?} = Logger.Config.__data__
376373

377374
if compare_levels(level, min_level) != :lt do
378375
tuple = {Logger, truncate(chardata, truncate), Logger.Utils.timestamp(utc_log?),
379376
[pid: self()] ++ metadata() ++ metadata}
380377
try do
381-
notify(mode, {level, Process.group_leader(), tuple}, timeout)
378+
notify(mode, {level, Process.group_leader(), tuple})
382379
:ok
383380
rescue
384381
ArgumentError -> {:error, :noproc}
@@ -462,6 +459,6 @@ defmodule Logger do
462459
defp truncate(data, n),
463460
do: Logger.Utils.truncate(to_string(data), n)
464461

465-
defp notify(:sync, msg, timeout), do: GenEvent.sync_notify(Logger, msg, timeout)
466-
defp notify(:async, msg, _timeout), do: GenEvent.notify(Logger, msg)
462+
defp notify(:sync, msg), do: GenEvent.sync_notify(Logger, msg)
463+
defp notify(:async, msg), do: GenEvent.notify(Logger, msg)
467464
end

lib/logger/lib/logger/config.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,14 @@ defmodule Logger.Config do
134134

135135
defp compute_state(mode) do
136136
level = Application.get_env(:logger, :level)
137-
timeout = Application.get_env(:logger, :timeout)
138137
utc_log = Application.get_env(:logger, :utc_log)
139138
truncate = Application.get_env(:logger, :truncate)
140139
translators = Application.get_env(:logger, :translators)
141140

142141
sync_threshold = Application.get_env(:logger, :sync_threshold)
143142
async_threshold = trunc(sync_threshold * 0.75)
144143

145-
persist %{level: level, mode: mode, timeout: timeout, truncate: truncate,
144+
persist %{level: level, mode: mode, truncate: truncate,
146145
utc_log: utc_log, sync_threshold: sync_threshold,
147146
async_threshold: async_threshold, translators: translators}
148147
end

lib/logger/mix.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ defmodule Logger.Mixfile do
1111
[registered: [Logger, Logger.Supervisor, Logger.Watcher],
1212
mod: {Logger.App, []},
1313
env: [level: :debug,
14-
timeout: 5000,
1514
utc_log: false,
1615
truncate: 8096,
1716
backends: [:console],

0 commit comments

Comments
 (0)