File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -506,7 +506,8 @@ defmodule Logger do
506506 :sync_threshold ,
507507 :truncate ,
508508 :level ,
509- :utc_log
509+ :utc_log ,
510+ :discard_threshold
510511 ]
511512 @ spec configure ( keyword ) :: :ok
512513 def configure ( options ) do
Original file line number Diff line number Diff line change @@ -348,4 +348,21 @@ defmodule LoggerTest do
348348 Logger.App . stop ( )
349349 Application . start ( :logger )
350350 end
351+
352+ test "configure/1 sets options" do
353+ Logger . configure ( sync_threshold: 10 )
354+ Logger . configure ( truncate: 4048 )
355+ Logger . configure ( utc_log: true )
356+ Logger . configure ( discard_threshold: 10_000 )
357+ logger_data = Logger.Config . __data__ ( )
358+ assert Map . get ( logger_data , :sync_threshold ) == 10
359+ assert Map . get ( logger_data , :truncate ) == 4048
360+ assert Map . get ( logger_data , :utc_log ) == true
361+ assert Map . get ( logger_data , :discard_threshold ) == 10_000
362+ after
363+ Logger . configure ( sync_threshold: 20 )
364+ Logger . configure ( sync_threshold: 8096 )
365+ Logger . configure ( utc_log: false )
366+ Logger . configure ( discard_threshold: 500 )
367+ end
351368end
You can’t perform that action at this time.
0 commit comments