package index
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A platform-agnostic multi-level index for OCaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
index-1.5.0.tbz
sha256=2e311cd0bad5b831ac4cebacc83d319b0bca7d5b713ef42dca2bcc064cda34e0
sha512=02d9bfe68daba9c857455244708bf7f25aac50a02a3c14b35cc499dd2a0ccfe5fa47016aea783efadc652bd922c6d4216eac8188400617e98ddc3eb98b9c16c3
doc/src/index/log.ml.html
Source file log.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 55 56 57 58 59 60 61 62 63 64 65(* The MIT License Copyright (c) 2019 Craig Ferguson <craig@tarides.com> Thomas Gazagnaire <thomas@tarides.com> Ioana Cristescu <ioana@tarides.com> Clément Pascutto <clement@tarides.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. *) open! Import let src = Logs.Src.create "index" ~doc:"Index" module Log = (val Logs.src_log src : Logs.LOG) include Log let default_reporter (type c) ?(prefix = "") (module Clock : Platform.CLOCK with type counter = c) (counter : c) = let report src level ~over k msgf = let k _ = over (); k () in let ppf = match level with Logs.App -> Fmt.stdout | _ -> Fmt.stderr in let with_stamp h k fmt = let dt = Mtime.Span.to_us (Clock.count counter) in Fmt.kpf k ppf ("%s%+04.0fus %a %a @[" ^^ fmt ^^ "@]@.") prefix dt Logs_fmt.pp_header (level, h) Fmt.(styled `Magenta string) (Logs.Src.name src) in msgf @@ fun ?header ? fmt -> with_stamp header tags k fmt in { Logs.report } let setup ?reporter ?style_renderer ?level (module Clock : Platform.CLOCK) = let start_time = Clock.counter () in let reporter = match reporter with | Some x -> x | None -> default_reporter (module Clock) start_time in Fmt_tty.setup_std_outputs ?style_renderer (); Logs.set_level level; Logs.set_reporter reporter; () open Cmdliner let ( let+ ) t f = Term.(const f $ t) let ( and+ ) a b = Term.(const (fun x y -> (x, y)) $ a $ b) let setup_term ?reporter (module Clock : Platform.CLOCK) = let+ style_renderer = Fmt_cli.style_renderer () and+ level = Logs_cli.level () in setup ?reporter ?style_renderer ?level (module Clock : Platform.CLOCK)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>