@@ -585,24 +585,24 @@ defmodule Logger do
585585 end
586586
587587 @ doc """
588- Alters the current process metadata according to the given keyword list .
588+ Alters the current process metadata according to the given enumerable .
589589
590- This function will merge the given keyword list into the existing metadata,
590+ This function will merge the given enumerable into the existing metadata,
591591 with the exception of setting a key to `nil`, which will remove that key
592592 from the metadata.
593593
594594 Note some metadata keys are reserved and cannot be overridden. See
595595 [the module documentation](#module-metadata) for more information.
596596 """
597- @ spec metadata ( metadata ) :: :ok
598- def metadata ( keyword ) do
597+ @ spec metadata ( Enumerable . t ( { atom ( ) , term ( ) } ) ) :: :ok
598+ def metadata ( enumerable ) do
599599 case :logger . get_process_metadata ( ) do
600600 :undefined ->
601- reset_metadata ( keyword )
601+ reset_metadata ( enumerable )
602602
603603 map when is_map ( map ) ->
604604 metadata =
605- Enum . reduce ( keyword , map , fn
605+ Enum . reduce ( enumerable , map , fn
606606 { k , nil } , acc -> Map . delete ( acc , k )
607607 { k , v } , acc -> Map . put ( acc , k , v )
608608 end )
@@ -626,11 +626,11 @@ defmodule Logger do
626626 end
627627
628628 @ doc """
629- Resets the current process metadata to the given keyword list .
629+ Resets the current process metadata to the given enumerable .
630630 """
631- @ spec reset_metadata ( metadata ) :: :ok
632- def reset_metadata ( keyword \\ [ ] ) do
633- :ok = :logger . set_process_metadata ( filter_out_nils ( keyword ) )
631+ @ spec reset_metadata ( Enumerable . t ( { atom ( ) , term ( ) } ) ) :: :ok
632+ def reset_metadata ( enumerable \\ [ ] ) do
633+ :ok = :logger . set_process_metadata ( filter_out_nils ( enumerable ) )
634634 end
635635
636636 defp filter_out_nils ( keyword ) do
0 commit comments