Skip to content
This repository has been archived by the owner on Nov 28, 2017. It is now read-only.

Commit

Permalink
Merge pull request #74 from djs55/better-debug
Browse files Browse the repository at this point in the history
Update to new shared-block-ring tracing API
  • Loading branch information
djs55 committed Jun 16, 2015
2 parents 63f33a0 + 1e78f5d commit 5b3773e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/s.mli → lib/s.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)
open Sexplib.Std

module type PRINT = sig
type t
Expand Down Expand Up @@ -38,10 +39,18 @@ module type SEXPABLE = sig
val sexp_of_t: t -> Sexplib.Sexp.t
end

type traced_operation = [
| `Set of string * string * [ `Producer | `Consumer | `Suspend | `Suspend_ack ] * [ `Int64 of int64 | `Bool of bool ]
| `Get of string * string * [ `Producer | `Consumer | `Suspend | `Suspend_ack ] * [ `Int64 of int64 | `Bool of bool ]
] with sexp
type traced_operation_list = traced_operation list with sexp

module type LOG = sig
val debug : ('a, unit, string, unit) format4 -> 'a
val info : ('a, unit, string, unit) format4 -> 'a
val error : ('a, unit, string, unit) format4 -> 'a

val trace: traced_operation list -> unit
end

type error = [
Expand Down
2 changes: 2 additions & 0 deletions lib_test/vg_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module Log = struct
let info fmt = Printf.ksprintf (fun s -> print_endline s) fmt
let error fmt = Printf.ksprintf (fun s -> print_endline s) fmt

let trace _ = ()

let _ =
debug "This is the debug output";
info "This is the info output";
Expand Down
2 changes: 2 additions & 0 deletions src/impl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ module Log = struct
let debug fmt = Printf.ksprintf (fun s -> print_endline s) fmt
let info fmt = Printf.ksprintf (fun s -> print_endline s) fmt
let error fmt = Printf.ksprintf (fun s -> print_endline s) fmt

let trace _ = ()
end

let read common filename =
Expand Down

0 comments on commit 5b3773e

Please sign in to comment.