package p4spectec
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
P4-SpecTec: A mechanization toolchain for the P4 Programming Language
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.1.2.tar.gz
md5=1a3bc0a385fe1ecf403c019f49aa6de6
sha512=5d20b5821f33e2a3a5419b208606f27c01511994c2b3b1e1cdf4c077056dfd0aa81682af0720e1060ee2bfb0341918fcc4c53159820205a2bc32b725e5c1a714
doc/src/p4spectec.backend_testgen_neg/logger.ml.html
Source file logger.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54(* Logging fuzz states *) type t = out_channel (* Constructor *) let setup_signal_handler (oc : out_channel) = let handler _ = print_endline ">>> Caught interrupt, flushing logs"; close_out oc; exit 1 in Sys.set_signal Sys.sigint (Sys.Signal_handle handler) let init (logname : string) : t = let oc = open_out logname in setup_signal_handler oc; oc (* Logging *) let log (logmode : Modes.logmode) (oc : t) (msg : string) : unit = let timestamp = let tm = Unix.localtime (Unix.time ()) in Printf.sprintf "[%02d:%02d:%02d]" tm.tm_hour tm.tm_min tm.tm_sec in let msg = Format.asprintf "[%s] >>> %s" timestamp msg in if logmode = Verbose then print_endline msg; msg ^ "\n" |> output_string oc; flush oc let mark (logmode : Modes.logmode) (oc : t) (msg : string) : unit = let timestamp = let tm = Unix.localtime (Unix.time ()) in Printf.sprintf "[%02d:%02d:%02d]" tm.tm_hour tm.tm_min tm.tm_sec in let msg = Format.asprintf "[%s] ### %s" timestamp msg in if logmode = Verbose then print_endline msg; msg ^ "\n" |> output_string oc; flush oc let warn (logmode : Modes.logmode) (oc : t) (msg : string) : unit = let timestamp = let tm = Unix.localtime (Unix.time ()) in Printf.sprintf "[%02d:%02d:%02d]" tm.tm_hour tm.tm_min tm.tm_sec in let msg = Format.asprintf "[%s] !!! %s" timestamp msg in if logmode = Verbose then print_endline msg; msg ^ "\n" |> output_string oc; flush oc (* Closing *) let close (oc : t) = close_out oc
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>