Permalink
Browse files

fix Hh_logger.Level in daemon

Summary:
`Hh_logger.Level.min_level` is a global that needs to be set when we
daemonize.

This prevented `FLOW_LOG_LEVEL` from working for `flow start`.

Reviewed By: gabelevi

Differential Revision: D5535716

fbshipit-source-id: ae0407608dc651f291213a8be739eee4d96e1a6d
  • Loading branch information...
mroch authored and hhvm-bot committed Aug 2, 2017
1 parent 5c6bb6c commit 7a922c9469dfd646577b2638760adb5456714463
Showing with 5 additions and 3 deletions.
  1. +5 −3 hphp/hack/src/utils/hh_logger.ml
@@ -40,6 +40,7 @@ module Level : sig
| Warn
| Info
| Debug
val min_level : unit -> t
val set_min_level : t -> unit
val log : t -> ('a, unit, string, string, string, unit) format6 -> 'a
end = struct
@@ -59,11 +60,12 @@ end = struct
| Info -> 2
| Debug -> 1
let min_level = ref Info
let set_min_level level = min_level := level
let min_level_ref = ref Info
let min_level () = !min_level_ref
let set_min_level level = min_level_ref := level
let log level fmt =
if int_of_level level >= int_of_level !min_level
if int_of_level level >= int_of_level !min_level_ref
then log fmt
else Printf.ifprintf () fmt
end

0 comments on commit 7a922c9

Please sign in to comment.