air_log_targets/
lib.rs

1/*
2 * Copyright 2021 Fluence Labs Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/// Print out each instruction name at the beginning of its execution_step.
18pub const INSTRUCTION: &str = "instruction";
19
20/// Print out data cache at the beginning of each instruction execution_step.
21pub const DATA_CACHE: &str = "data_cache";
22
23/// Print out next_peer_pks at the beginning of each instruction execution_step.
24pub const NEXT_PEER_PKS: &str = "next_peer_pks";
25
26/// Print out subgraph_complete value at the beginning of each instruction execution_step.
27pub const SUBGRAPH_COMPLETE: &str = "subgraph_complete";
28
29/// Print out count of element in the current subgraph at the beginning of each instruction execution_step.
30pub const SUBGRAPH_ELEMENTS: &str = "subgraph_elements_count";
31
32/// Print out state of data cache at the beginning of each instruction execution_step.
33pub const NEW_EXECUTED_TRACE: &str = "new_executed_trace";
34
35/// Print out logs at the executed states merging stage.
36pub const EXECUTED_TRACE_MERGE: &str = "executed_trace_merge";
37
38/// Print out running arguments and params of a script.
39pub const RUN_PARAMS: &str = "initial_params";
40
41/// Print out state of data cache at the beginning of each instruction execution_step.
42pub const EXECUTED_STATE_CHANGING: &str = "executed_state_changing";
43
44/// Print log if call is postponed due the join behaviour.
45pub const JOIN_BEHAVIOUR: &str = "join_behaviour";
46
47/// This map should be used by rust-sdk logger that allows print only necessary targets by id.
48pub const TARGET_MAP: [(&str, i32); 10] = [
49    (INSTRUCTION, 1 << 1),
50    (DATA_CACHE, 1 << 2),
51    (NEXT_PEER_PKS, 1 << 3),
52    (SUBGRAPH_COMPLETE, 1 << 4),
53    (SUBGRAPH_ELEMENTS, 1 << 5),
54    (NEW_EXECUTED_TRACE, 1 << 6),
55    (EXECUTED_TRACE_MERGE, 1 << 7),
56    (RUN_PARAMS, 1 << 8),
57    (EXECUTED_STATE_CHANGING, 1 << 9),
58    (JOIN_BEHAVIOUR, 1 << 10),
59];