… | |
… | |
21 | |
21 | |
22 | my $self = $class->SUPER::new (%arg, |
22 | my $self = $class->SUPER::new (%arg, |
23 | setup_req => { |
23 | setup_req => { |
24 | extmap => 1, |
24 | extmap => 1, |
25 | excmd => 1, |
25 | excmd => 1, |
26 | ywidget => 1,#d# |
26 | xwidget => 1,#d# |
27 | %{$arg{setup_req} || {}}, |
27 | %{$arg{setup_req} || {}}, |
28 | }, |
28 | }, |
29 | ); |
29 | ); |
30 | |
30 | |
31 | $self->{map_widget}->clr_commands; |
31 | $self->{map_widget}->clr_commands; |
… | |
… | |
226 | } |
226 | } |
227 | |
227 | |
228 | sub logprint { |
228 | sub logprint { |
229 | my ($self, @a) = @_; |
229 | my ($self, @a) = @_; |
230 | |
230 | |
231 | $self->{log_fh} ||= do { |
231 | CFPlus::DB::logprint "$Crossfire::VARDIR/log.$self->{host}" => (join "", @a), sub { }; |
232 | my $path = "$Crossfire::VARDIR/log.$self->{host}"; |
|
|
233 | |
|
|
234 | open my $fh, ">>:utf8", $path |
|
|
235 | or die "Couldn't open logfile $path: $!"; |
|
|
236 | |
|
|
237 | $fh->autoflush (1); |
|
|
238 | |
|
|
239 | $fh; |
|
|
240 | }; |
|
|
241 | |
|
|
242 | my ($sec, $min, $hour, $mday, $mon, $year) = localtime time; |
|
|
243 | |
|
|
244 | my $ts = sprintf "%04d-%02d-%02d %02d:%02d:%02d", |
|
|
245 | $year + 1900, $mon + 1, $mday, $hour, $min, $sec; |
|
|
246 | |
|
|
247 | print {$self->{log_fh}} "$ts ", @a, "\n"; |
|
|
248 | } |
232 | } |
249 | |
233 | |
250 | sub _stat_numdiff { |
234 | sub _stat_numdiff { |
251 | my ($self, $name, $old, $new) = @_; |
235 | my ($self, $name, $old, $new) = @_; |
252 | |
236 | |