package miaou-core
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Miaou core/widgets (no drivers, no SDL)
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.5.2.tar.gz
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/src/miaou-core.core/tui_logger.ml.html
Source file tui_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 55 56 57 58 59 60 61 62 63 64 65(*****************************************************************************) (* *) (* SPDX-License-Identifier: MIT *) (* Copyright (c) 2025 Nomadic Labs <contact@nomadic-labs.com> *) (* *) (*****************************************************************************) [@@@warning "-32-34-37-69"] open Miaou_interfaces.Logger_capability let enabled = ref false let ch : out_channel option ref = ref None let level_to_string = function | Debug -> "DBG" | Info -> "INF" | Warning -> "WRN" | Error -> "ERR" let timestamp () = let open Unix in let tm = gmtime (time ()) in Printf.sprintf "%04d-%02d-%02dT%02d:%02d:%02dZ" (tm.tm_year + 1900) (tm.tm_mon + 1) tm.tm_mday tm.tm_hour tm.tm_min tm.tm_sec let set_enabled b = enabled := b let set_logfile path_opt = try (match !ch with Some oc -> close_out_noerr oc | None -> ()) ; (ch := match path_opt with | None -> None | Some p -> Some (open_out_gen [Open_creat; Open_text; Open_wronly; Open_append] 0o644 p)) ; Ok () with e -> Error (Printexc.to_string e) let logf level msg = if not !enabled then () else let formatted_msg = Printf.sprintf "[%s] %s: %s" (timestamp ()) (level_to_string level) msg in match !ch with | Some oc -> output_string oc formatted_msg ; output_char oc '\n' ; flush oc | None -> output_string stderr formatted_msg ; output_char stderr '\n' ; flush stderr
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>