Skip to content
Snippets Groups Projects
Commit c56b4f16 authored by Michele Alberti's avatar Michele Alberti
Browse files

[log] Rework source printing: print a space only for non-app logs.

parent 2e3169a2
No related branches found
No related tags found
No related merge requests found
...@@ -42,13 +42,14 @@ let reporter = ...@@ -42,13 +42,14 @@ let reporter =
in in
msgf @@ fun ?header ?tags:_ fmt -> msgf @@ fun ?header ?tags:_ fmt ->
let ppf = if level = Logs.App then Fmt.stdout else Fmt.stderr in let ppf = if level = Logs.App then Fmt.stdout else Fmt.stderr in
let print_src fmt src = let pp_src fmt src =
if not (Logs.Src.equal Logs.default src) if Logs.Src.equal Logs.default src
then Fmt.pf fmt "@[{%s}@] " (Logs.Src.name src) then (if level <> Logs.App then Fmt.pf fmt " ")
else Fmt.pf fmt "@[{%s}@] " (Logs.Src.name src)
in in
Format.kfprintf k ppf Format.kfprintf k ppf
("%a%a@[" ^^ fmt ^^ "@]@.") ("%a%a@[" ^^ fmt ^^ "@]@.")
Logs.pp_header (level, header) print_src src Logs_fmt.pp_header (level, header) pp_src src
in in
{ Logs.report } { Logs.report }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment