3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-30 07:59:42 +01:00

Spinach: Wrap state debug dump with debug_state flag

This commit is contained in:
Pragmatic Software 2019-05-15 10:58:32 -07:00
parent 881be00abe
commit 57a4434289

View File

@ -197,7 +197,8 @@ sub load_metadata {
seen_expiry => 432000, seen_expiry => 432000,
min_difficulty => 0, min_difficulty => 0,
max_difficulty => 25000, max_difficulty => 25000,
max_missed_inputs => 3, max_missed_inputs => 3
debug_state => 0,
}; };
if (not exists $self->{metadata}->hash->{settings}) { if (not exists $self->{metadata}->hash->{settings}) {
@ -1139,7 +1140,7 @@ sub run_one_state {
} }
# dump new state data for logging/debugging # dump new state data for logging/debugging
if ($state_data->{newstate}) { if ($state_data->{newstate} and $self->{metadata}->{hash}->{settings}->{debug_state}) {
$self->{pbot}->{logger}->log("Spinach: New state: $self->{previous_state} ($state_data->{previous_result}) --> $self->{current_state}\n" . Dumper $state_data); $self->{pbot}->{logger}->log("Spinach: New state: $self->{previous_state} ($state_data->{previous_result}) --> $self->{current_state}\n" . Dumper $state_data);
} }