@ -59,9 +59,9 @@ format(LgMsg, Config, Colors) ->
] .
fmtCfg ( [ ] ) - >
[ datetime , color , < < " [ " > > , severity , < < " ] " > > , node , < < " | " > > , pid , < < " | " > > , module , < < " | " > > , function , < < " | " > > , line , < < " | " > > , message , < < " \n " > > ] ;
[ datetime , < < " [ " > > , severity , < < " ] " > > , node , < < " | " > > , pid , < < " | " > > , module , < < " | " > > , function , < < " | " > > , line , < < " | " > > , message , < < " \n " > > ] ;
fmtCfg ( MetaWhitelist ) - >
[ datetime , color , < < " [ " > > , severity , < < " ] " > > , node , < < " | " > > , pid , < < " | " > > , module , < < " | " > > , function , < < " | " > > , line , < < " | " > > ] ++
[ datetime , < < " [ " > > , severity , < < " ] " > > , node , < < " | " > > , pid , < < " | " > > , module , < < " | " > > , function , < < " | " > > , line , < < " | " > > ] ++
[ { M , [ atom_to_binary ( M ) , < < " = " > > , M , " | " ] , [ < < > > ] } | | M < - MetaWhitelist ] ++ [ message , < < " \n " > > ] .
% Level , Pid , Node , Module , Function , FunctionArity , Line
@ -71,8 +71,8 @@ fmtCfg(MetaWhitelist) ->
- spec output ( term ( ) , lgMsg ( ) ) - > iolist ( ) .
output ( message , LgMsg ) - > LgMsg #lgMsg.message ;
output ( datetime , LgMsg ) - > LgMsg #lgMsg.datetime ;
output ( pid , LgMsg ) - > LgMsg #lgMsg.pid ;
output ( node , LgMsg ) - > LgMsg #lgMsg.node ;
output ( pid , LgMsg ) - > pid_to_list ( LgMsg #lgMsg.pid ) ;
output ( node , LgMsg ) - > atom_to_binary ( LgMsg #lgMsg.node , utf8 ) ;
output ( datetime , LgMsg ) - > LgMsg #lgMsg.datetime ;
output ( module , LgMsg ) - > atom_to_binary ( LgMsg #lgMsg.module , utf8 ) ;
output ( function , LgMsg ) - > atom_to_binary ( LgMsg #lgMsg.function , utf8 ) ;
@ -92,7 +92,7 @@ output({pterm, Key}, _LgMsg) ->
output ( { pterm , Key , Default } , _ LgMsg ) - >
makeStr ( getPTerm ( Key , Default ) ) ;
output ( Prop , LgMsg ) when is_atom ( Prop ) - >
makeStr ( getMdKey ( Prop , LgMsg , < < " Undefined " > > ) ) ;
makeStr ( getMdKey ( Prop , LgMsg , < < " Undef " > > ) ) ;
output ( { Prop , Default } , LgMsg ) when is_atom ( Prop ) - >
makeStr ( getMdKey ( Prop , LgMsg , output ( Default , LgMsg ) ) ) ;
output ( { Prop , Present , Absent } , LgMsg ) when is_atom ( Prop ) - >
@ -114,8 +114,8 @@ output(Other, _) -> makeStr(Other).
output ( message , LgMsg , _ Width ) - > LgMsg #lgMsg.message ;
output ( datetime , LgMsg , _ Width ) - > LgMsg #lgMsg.datetime ;
output ( pid , LgMsg , _ Width ) - > LgMsg #lgMsg.pid ;
output ( node , LgMsg , _ Width ) - > LgMsg #lgMsg.node ;
output ( pid , LgMsg , _ Width ) - > pid_to_list ( LgMsg #lgMsg.pid ) ;
output ( node , LgMsg , _ Width ) - > atom_to_binary ( LgMsg #lgMsg.node , utf8 ) ;
output ( module , LgMsg , _ Width ) - > atom_to_binary ( LgMsg #lgMsg.module , utf8 ) ;
output ( function , LgMsg , _ Width ) - > atom_to_binary ( LgMsg #lgMsg.function , utf8 ) ;
output ( line , LgMsg , _ Width ) - > integer_to_binary ( LgMsg #lgMsg.line ) ;
@ -132,7 +132,7 @@ output({metadata, IntSep, FieldSep}, LgMsg, _Width) ->
output ( { pterm , Key } , _ LgMsg , _ Width ) - > makeStr ( getPTerm ( Key , < < " " > > ) ) ;
output ( { pterm , Key , Default } , _ LgMsg , _ Width ) - > makeStr ( getPTerm ( Key , Default ) ) ;
output ( Prop , LgMsg , Width ) when is_atom ( Prop ) - >
makeStr ( getMdKey ( Prop , LgMsg , < < " Undefined " > > ) , Width ) ;
makeStr ( getMdKey ( Prop , LgMsg , < < " Undef " > > ) , Width ) ;
output ( { Prop , Default } , LgMsg , Width ) when is_atom ( Prop ) - >
makeStr ( getMdKey ( Prop , LgMsg , output ( Default , LgMsg ) ) , Width ) ;
output ( Other , _ , Width ) - > makeStr ( Other , Width ) .