Module Logging.Make

Functor that creates an implementation for Logger, given the Message and Event modules.

Parameters

module Event : Events.Event with type msg = Message.t

Signature

type ev = Event.t

The type of events being logged.

val init : unit -> unit

Initialize the logger.

val terminate : unit -> unit

Close the logger.

val log_event : ev -> unit

Logs an event to the JSON log.

  • parameter ev

    the event to be logged

val print_in_committee : int -> int -> unit

Logs that a node belongs to a committee of a round.

  • parameter node_id

    the id of a node

  • parameter round

    the round where the node belongs to the committee

val print_is_proposer : int -> int -> unit

Logs that a node is a proposer for a round.

  • parameter node_id

    the id of a node

  • parameter round

    the round where the node is a proposer

val print_create_block : int -> int -> unit

Print that a node has minted a block.

  • parameter minter

    the id of the node

  • parameter block

    the id of the newly minted block

val print_new_chain_head : int -> int -> int -> unit

Print that the head of a node's chain as been updated.

  • parameter node_id

    id of the node that update its chain

  • parameter minter

    id of the node that minted the block that was added to node_id's chain

  • parameter block

    id of the block that was added to node_id's chain

val log_parameters : string -> unit

Receives a JSON string with the parameters and logs them.

  • parameter parameters

    a JSON string containing the relevant simulation parameters

val log_statistics : string -> unit

Receives a JSON string with the statistics and logs them.

  • parameter stats

    a JSON string containing the computed statistics of the simulation

val log_per_node_statistics : string -> unit

Receives a JSON string with the per node statistics and logs them.

  • parameter stats

    a JSON string containing the computed per-node-statistics of the simulation

val log_add_node : int -> int -> unit

Log the addition of a node.

  • parameter node_id

    the id of the node

  • parameter region

    the region where the node was added

Log the addition of a link.

  • parameter node1

    the id of the node at the link's origin

  • parameter node2

    the id of the node at the link's end

Log the removal of a link.

  • parameter node1

    the id of the node at the link's origin

  • parameter node2

    the id of the node at the link's end

val log_protocol : int -> unit

Log wheter it is a blockchain or abstract protocol.

  • parameter type

    if 0 then abstract. if 1 then blockchain.