Skip to content

Commit b75cccc

Browse files
committed
Describe why Logger.flush is not advised in production
1 parent 4328b09 commit b75cccc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/logger/lib/logger.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,11 @@ defmodule Logger do
702702
@doc """
703703
Flushes the logger.
704704
705-
This guarantees all log handlers are flushed. This is useful
706-
for testing and it should not be called in production code.
705+
This guarantees all logger handlers flush to disk or storage.
706+
This is useful for testing but it should be avoided in production,
707+
as it could force logger handlers to drop whatever they are doing
708+
and flush, even if continuing to buffer would be the most peformant
709+
option.
707710
"""
708711
@spec flush :: :ok
709712
def flush do

0 commit comments

Comments
 (0)