Tezos_store_shared.Store_eventsinclude module type of struct include Tezos_base.TzPervasives.Internal_event.Simple endThis module provides wrappers to declare events without having to declare a module and apply the Make functor. They are pretty-printed as <DOC> (<PARAMETER> = <VALUE>, ...) (unless there is no parameter at all, in which case they are printed as <DOC>). You may also use braces to inline some parameters in <DOC>. In the example below, hash is inlined.
For consistency, it is suggested that log messages do not start with a capital letter and do not end with a period. For instance, write ~msg: "started something important" instead of ~msg: "Started something important.". The reason is that messages that do not inline all of their parameters are followed by the remaining parameters in parentheses, and a period does not (arguably) look great in those cases. If it does not end with a period, it is not a sentence and thus capitalizing the first word does not make much sense either.
Declare events with one of the declare functions, for instance: let inject = Internal_event.Simple.declare_2 ~name: "inject" ~section:["foo"; "bar"] ~prefix_name_with_sections:false ~msg: "injected block {hash}" ("level", int) ("hash", string) You must declare events only once for a given name. Usually you should thus declare them as global variables.
A way to enforce name uniqueness is to set prefix_name_with_sections to true. In the example above, this would compute a new event name of the form "foo.bar.inject".
There is one declare_n function for each number n of parameters. For instance, the above example uses declare_2 because it has two parameters: level and hash.
Each parameter has a default pretty-printer that you can override using the ?ppX parameters. For instance, to override the default pretty-printer of the second parameter, pass a ~pp2 argument. This allows to, for instance, print only the first element of a list, remove quotes for strings, decide how many decimal digits are printed for floats, etc.
The default pretty-printer behaves as follows:
[...];N/A;Null and another encoding e (this is the encoding of options), it prints null for Null and uses e to decide how to print the value otherwise;<list> or <obj> (see remark below).Because constructed values such as lists and objects are printed as placeholders such as <list> and <obj> and thus do not give any information, those parameters are not automatically added in parentheses at the end of the messages. You can override the default pretty-printer of those parameters to override this behavior. In that case, values will be printed if your pretty-printer does not output an empty string. Note that you should also override the default pretty-printer of constructed types that you inline using braces, as they would be printed using the placeholder otherwise.
Then emit this event with some parameters like this: Internal_event.Simple.emit inject (42, "BL654654654645654654564") This event will be printed as: injected block BL654654654645654654564 (level = 42)
For all declare functions, the default value for level is Info.
type 'a t = 'a Tezos_event_logging.Internal_event.Simple.tEvent declarations where 'a is the type of the event parameters.
val emit : 'a t -> 'a -> unit Lwt.tEmit an instance of an event.
val emit_at_top_level : 'a t -> 'a -> unitEmit an instance of an event if called at toplevel
val emit__dont_wait__use_with_care : 'a t -> 'a -> unitEmit an instance of an event but do not wait for completion. Only use if you really need to not wait for logging resolution before continuing. May cause increased memory usage and out-of-order log messages.
val declare_0 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
unit ->
unit tDeclare an event with no parameters.
val declare_1 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
?pp1:(Stdlib.Format.formatter -> 'a -> unit) ->
(string * 'a Data_encoding.t) ->
'a tDeclare an event with one parameter.
val declare_2 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
?pp1:(Stdlib.Format.formatter -> 'a -> unit) ->
(string * 'a Data_encoding.t) ->
?pp2:(Stdlib.Format.formatter -> 'b -> unit) ->
(string * 'b Data_encoding.t) ->
('a * 'b) tDeclare an event with two parameters.
val declare_3 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
?pp1:(Stdlib.Format.formatter -> 'a -> unit) ->
(string * 'a Data_encoding.t) ->
?pp2:(Stdlib.Format.formatter -> 'b -> unit) ->
(string * 'b Data_encoding.t) ->
?pp3:(Stdlib.Format.formatter -> 'c -> unit) ->
(string * 'c Data_encoding.t) ->
('a * 'b * 'c) tDeclare an event with three parameters.
val declare_4 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
?pp1:(Stdlib.Format.formatter -> 'a -> unit) ->
(string * 'a Data_encoding.t) ->
?pp2:(Stdlib.Format.formatter -> 'b -> unit) ->
(string * 'b Data_encoding.t) ->
?pp3:(Stdlib.Format.formatter -> 'c -> unit) ->
(string * 'c Data_encoding.t) ->
?pp4:(Stdlib.Format.formatter -> 'd -> unit) ->
(string * 'd Data_encoding.t) ->
('a * 'b * 'c * 'd) tDeclare an event with four parameters.
val declare_5 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
?pp1:(Stdlib.Format.formatter -> 'a -> unit) ->
(string * 'a Data_encoding.t) ->
?pp2:(Stdlib.Format.formatter -> 'b -> unit) ->
(string * 'b Data_encoding.t) ->
?pp3:(Stdlib.Format.formatter -> 'c -> unit) ->
(string * 'c Data_encoding.t) ->
?pp4:(Stdlib.Format.formatter -> 'd -> unit) ->
(string * 'd Data_encoding.t) ->
?pp5:(Stdlib.Format.formatter -> 'e -> unit) ->
(string * 'e Data_encoding.t) ->
('a * 'b * 'c * 'd * 'e) tDeclare an event with five parameters.
val declare_6 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
?pp1:(Stdlib.Format.formatter -> 'a -> unit) ->
(string * 'a Data_encoding.t) ->
?pp2:(Stdlib.Format.formatter -> 'b -> unit) ->
(string * 'b Data_encoding.t) ->
?pp3:(Stdlib.Format.formatter -> 'c -> unit) ->
(string * 'c Data_encoding.t) ->
?pp4:(Stdlib.Format.formatter -> 'd -> unit) ->
(string * 'd Data_encoding.t) ->
?pp5:(Stdlib.Format.formatter -> 'e -> unit) ->
(string * 'e Data_encoding.t) ->
?pp6:(Stdlib.Format.formatter -> 'f -> unit) ->
(string * 'f Data_encoding.t) ->
('a * 'b * 'c * 'd * 'e * 'f) tDeclare an event with six parameters.
val declare_7 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
?pp1:(Stdlib.Format.formatter -> 'a -> unit) ->
(string * 'a Data_encoding.t) ->
?pp2:(Stdlib.Format.formatter -> 'b -> unit) ->
(string * 'b Data_encoding.t) ->
?pp3:(Stdlib.Format.formatter -> 'c -> unit) ->
(string * 'c Data_encoding.t) ->
?pp4:(Stdlib.Format.formatter -> 'd -> unit) ->
(string * 'd Data_encoding.t) ->
?pp5:(Stdlib.Format.formatter -> 'e -> unit) ->
(string * 'e Data_encoding.t) ->
?pp6:(Stdlib.Format.formatter -> 'f -> unit) ->
(string * 'f Data_encoding.t) ->
?pp7:(Stdlib.Format.formatter -> 'g -> unit) ->
(string * 'g Data_encoding.t) ->
('a * 'b * 'c * 'd * 'e * 'f * 'g) tDeclare an event with seven parameters.
val declare_8 :
?alternative_color:Tezos_event_logging.Internal_event.alternative_color ->
?section:string list ->
?prefix_name_with_section:bool ->
name:string ->
msg:string ->
?level:Tezos_event_logging.Internal_event.level ->
?pp1:(Stdlib.Format.formatter -> 'a -> unit) ->
(string * 'a Data_encoding.t) ->
?pp2:(Stdlib.Format.formatter -> 'b -> unit) ->
(string * 'b Data_encoding.t) ->
?pp3:(Stdlib.Format.formatter -> 'c -> unit) ->
(string * 'c Data_encoding.t) ->
?pp4:(Stdlib.Format.formatter -> 'd -> unit) ->
(string * 'd Data_encoding.t) ->
?pp5:(Stdlib.Format.formatter -> 'e -> unit) ->
(string * 'e Data_encoding.t) ->
?pp6:(Stdlib.Format.formatter -> 'f -> unit) ->
(string * 'f Data_encoding.t) ->
?pp7:(Stdlib.Format.formatter -> 'g -> unit) ->
(string * 'g Data_encoding.t) ->
?pp8:(Stdlib.Format.formatter -> 'h -> unit) ->
(string * 'h Data_encoding.t) ->
('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h) tDeclare an event with eight parameters.
val init_store : (bool * bool) tval end_init_store : unit tval set_head : Store_types.block_descriptor tval set_checkpoint : Store_types.block_descriptor tval set_target : Store_types.block_descriptor tval set_savepoint : Store_types.block_descriptor tval set_caboose : Store_types.block_descriptor tval store_block : Store_types.block_descriptor tval store_validated_block : Store_types.block_descriptor tval start_updating_floating_stores : unit tval cementing_block_ranges : (int32 * int32) list tval start_cementing_blocks : (int32 * int32) tval end_cementing_blocks : unit tval start_cementing_blocks_metadata : unit tval start_merging_thread : unit tval end_merging_thread : unit tval start_store_garbage_collection : unit tval start_merge_finalizer : unit tval start_retreiving_predecessors : unit tval start_retreiving_cycles : unit tval load_block_store_status : unit tval fixed_block_store_status : unit tval store_is_consistent : unit tval metadata_read_error : string tval start_merging_stores : int32 tval end_merging_stores : Tezos_base.TzPervasives.Time.System.Span.t tval maintenance_status : Tezos_shell_services.Storage_maintenance.delay tval delay_store_merging :
(Tezos_shell_services.Storage_maintenance.delay * int32) tval delayed_store_merging_countdown : int32 tval start_context_gc : Store_types.block_descriptor tval start_context_split : int32 tval start_store_sync : unit tval store_already_sync : unit tval store_quick_sync : unit tval store_full_sync : unit tval end_store_sync : Tezos_base.TzPervasives.Time.System.Span.t tval context_gc_is_not_allowed : unit tval try_waiting_for_merge_termination : unit tval switch_history_mode :
(Tezos_shell_services.History_mode.t * Tezos_shell_services.History_mode.t) tval inconsistent_store : Tezos_base.TzPervasives.Error_monad.tztrace tval fix_store : unit tval fix_floating_stores : unit tval fix_head :
(Store_types.block_descriptor option * Store_types.block_descriptor) tval fix_cementing_highwatermark : (int32 option * int32 option) tval fix_checkpoint :
(Store_types.block_descriptor option * Store_types.block_descriptor) tval fix_savepoint :
(Store_types.block_descriptor option * Store_types.block_descriptor) tval fix_caboose :
(Store_types.block_descriptor option * Store_types.block_descriptor) tval store_was_fixed : unit tval recover_merge : unit tval restore_protocols_table : unit tval restore_protocol_activation :
(int * Tezos_base.TzPervasives.Protocol_hash.t) tval update_protocol_table :
(Tezos_base.TzPervasives.Protocol_hash.t
* int
* Tezos_base.TzPervasives.Block_hash.t
* int32)
tval restore_history_mode : Tezos_shell_services.History_mode.t tval restore_inferred_history_mode : Tezos_shell_services.History_mode.t tval warning_missing_metadata : (int32 * int32) tval merge_error : (int32 * int32 * string) tval notify_merge_error : Tezos_base.TzPervasives.Error_monad.tztrace tval upgrade_store_failed : unit tval upgrade_store_started : unit tval upgrade_cemented_file_skip : string tval import_legacy_snapshot_version : int t