12 my ($this, $key, $value) = @_;
14 if (substr($key, 0, 10) eq "Watchdog::") {
15 substr $key, 0, 10, "";
16 $watched_variables{$key} = $value;
18 $main::lxdebug->_write("WATCH", "Starting to watch '$key' with current value '$this->{$key}'");
20 $main::lxdebug->_write("WATCH", "Stopping to watch '$key'");
26 if ($watched_variables{$key}
27 && ($this->{$key} ne $value)) {
28 my $subroutine = (caller 1)[3];
29 my ($self_filename, $self_line) = (caller)[1, 2];
30 $main::lxdebug->_write("WATCH",
31 "Value of '$key' changed from '$this->{$key}' to '$value' "
32 . "in ${subroutine} at ${self_filename}:${self_line}");
33 if ($watched_variables{$key} > 1) {
35 my ($dummy, $filename, $line);
37 while (($dummy, $filename, $line, $subroutine) = caller $level) {
38 $main::lxdebug->_write("WATCH", " ${subroutine} from ${filename}:${line}");
44 $this->{$key} = $value;
48 my ($this, $key) = @_;
50 if ($watched_variables{$key} && ($this->{$key} ne "")) {
51 my $subroutine = (caller 1)[3];
52 my ($self_filename, $self_line) = (caller)[1, 2];
53 $main::lxdebug->_write("WATCH",
54 "Value of '$key' changed from '$this->{$key}' to '' "
55 . "in ${subroutine} at ${self_filename}:${self_line}");
56 if ($watched_variables{$key} > 1) {
58 my ($dummy, $filename, $line);
60 while (($dummy, $filename, $line, $subroutine) = caller $level) {
61 $main::lxdebug->_write("WATCH", " ${subroutine} from ${filename}:${line}");