Skip to content

Commit

Permalink
verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Jan 7, 2017
1 parent 9f47831 commit 2b9f84a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis-ci.sh
Expand Up @@ -7,7 +7,7 @@ opam pin add --yes -n $(pwd)
opam install --yes gdb

make
./run_integration_test.native
RMP_LOG_VERBOSE=1 ./run_integration_test.native

#opam install --yes menhir extlib lwt ppx_deriving ppx_deriving_yojson oasis containers
#make
9 changes: 4 additions & 5 deletions cli/rmp.ml
Expand Up @@ -4,13 +4,12 @@ module String = ExtLib.String
let printfn fmt = ksprintf print_endline fmt
let eprintfn fmt = ksprintf prerr_endline fmt

let log_verbose = false

let log_verbose = try ignore @@ Sys.getenv "RMP_LOG_VERBOSE"; true with Not_found -> false
let section = Lwt_log.Section.make "gdb"
let () = if log_verbose then Lwt_log.Section.set_level section Lwt_log.Debug
let logger = Lwt_main.run @@ Lwt_log.file ~mode:`Append ~file_name:"rmp.log" ()
let () = Lwt_log.Section.set_level section (if log_verbose then Lwt_log.Debug else Lwt_log.Warning)
let logger = Lwt_log.channel ~close_mode:`Keep ~channel:Lwt_io.stdout ()
let log fmt = Lwt_log.ign_debug_f ~logger ~section (fmt ^^ "\n")
(* let log fmt = Printf.eprintf (fmt ^^ "\n") *)


let show_frame_cached =
let eq (f1 : Gdb.Proto.frame) (f2 : Gdb.Proto.frame) = f1.func = f2.func && f1.from = f2.from in
Expand Down

0 comments on commit 2b9f84a

Please sign in to comment.