package stdune

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Stdune.ConsoleSource

Manages the console

The console is a system than can report messages and a status to the user. It is usually the terminal the application is connected to, however it could be something else. This module allow to set a global backend for the application as well as composing backends.

Sourcemodule type Backend = sig ... end

The interface of a custom console backend.

Sourceval separate_messages : bool -> unit

separate_messages b changes the behavior of print_user_message, so that it separates messages with a blank line when b = true.

Sourceval set_directory : string -> unit

set_directory dir sets the directory to announce when output is printed. If any output occurs, "Entering directory '<dir>'" is printed before the first output, and "Leaving directory '<dir>'" is printed at finish time. If no output occurs, nothing is printed.

Sourcemodule Backend : sig ... end
Sourceval print_user_message : User_message.t -> unit

Format and print a user message to the console.

Sourceval reset_flush_history : unit -> unit

Reset the log output and (try) to remove the history.

Sourceval reset : unit -> unit

Reset the log output.

Sourceval finish : unit -> unit

Finish outputting to the console.

Sourceval print : User_message.Style.t Pp.t list -> unit

print paragraphs is a short-hand for:

  print_user_message (User_message.make paragraphs)
Sourceval printf : ('a, unit, string, unit) format4 -> 'a

printf fmt is a convenient function for debugging. It formats a string and then print it raw followed by a newline. It is the same as:

  print [Pp.verbatim (sprintf fmt ...)]

For properly formatted output you should use print.

Sourcemodule Status_line : sig ... end

Status line management