package b0

  1. Overview
  2. Docs

B0_std configuration.

Configure B0_std's colored output and B0_std.Log verbosity.

Cli arguments

val color : ?docs:string -> ?env:Cmdliner.Arg.env -> unit -> B0_std.Tty.cap option Cmdliner.Term.t

color ~docs ~env is a cli interface for specifiying the color capability of the terminal. Can be used with Fmt.set_tty_styling_cap. docs is where the options are documented env is an environment variable that can be used to override the default None (auto configuration).

val verbosity : ?docs:string -> ?env:Cmdliner.Arg.env -> unit -> B0_std.Log.level Cmdliner.Term.t

verbosity ~docs ~env () is a cli interface for specifiying the logging level. Can be used with Log.set_level. docs is where the options are documented. env is an environment variable that can be used to override the default value (Log.Warning).

val setup : ?docs:string -> ?log_spawns:B0_std.Log.level -> ?color_env:Cmdliner.Arg.env -> ?verbosity_env:Cmdliner.Arg.env -> unit -> unit Cmdliner.Term.t

setup ~docs ~log_spawns ~color_env ~verbosity_env () uses color and verbosity to setup:

  • B0_std.Fmt.set_tty_styling_cap, using Tty.of_fd on Unix.stdout if color is None.
  • B0_std.Log.set_level with verbosity.
  • log_spawns log B0_std.Os.Cmd spawns by setting up a B0_std.Os.Cmd.spawn_tracer that traces with the given level. If Level.Quiet is specified no tracer is registered. Defaults to B0_std.Log.Debug.

docs is where the section in which the options are documented and color_env and verbosity_env are used with the env argument of color and verbosity.

OCaml

Innovation. Community. Security.