Skip to content

Commit

Permalink
* more debugging output
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Jan 24, 2018
1 parent b7a79ac commit 9540ef7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGES
@@ -1,3 +1,7 @@
0.10.3 2018-01-24 more debugging output

0.10.2 2018-01-23 made hostchanel keepalive happy even when files get filtered

0.10.1 2016-09-30 made file filter more robust

0.10.0 2016-09-30 added minAge option
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.10.2
0.10.3
20 changes: 10 additions & 10 deletions configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for logFetcher 0.10.2.
# Generated by GNU Autoconf 2.69 for logFetcher 0.10.3.
#
# Report bugs to <tobi@oetiker.ch>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='logFetcher'
PACKAGE_TARNAME='logfetcher'
PACKAGE_VERSION='0.10.2'
PACKAGE_STRING='logFetcher 0.10.2'
PACKAGE_VERSION='0.10.3'
PACKAGE_STRING='logFetcher 0.10.3'
PACKAGE_BUGREPORT='tobi@oetiker.ch'
PACKAGE_URL=''

Expand Down Expand Up @@ -1228,7 +1228,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures logFetcher 0.10.2 to adapt to many kinds of systems.
\`configure' configures logFetcher 0.10.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1295,7 +1295,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of logFetcher 0.10.2:";;
short | recursive ) echo "Configuration of logFetcher 0.10.3:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1380,7 +1380,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
logFetcher configure 0.10.2
logFetcher configure 0.10.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand All @@ -1397,7 +1397,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by logFetcher $as_me 0.10.2, which was
It was created by logFetcher $as_me 0.10.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2268,7 +2268,7 @@ fi
# Define the identity of the package.
PACKAGE='logfetcher'
VERSION='0.10.2'
VERSION='0.10.3'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -3386,7 +3386,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by logFetcher $as_me 0.10.2, which was
This file was extended by logFetcher $as_me 0.10.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -3439,7 +3439,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
logFetcher config.status 0.10.2
logFetcher config.status 0.10.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
10 changes: 5 additions & 5 deletions lib/LogFetcher/Command/fetch.pm
Expand Up @@ -5,15 +5,15 @@ use LogFetcher::HostChannel;

=head1 NAME
LogFetcher::Command::sync - Ptp2Fibu3 syncer
LogFetcher::Command::fetch - Log File Syncer
=head1 SYNOPSIS
./logfetcher.pl fetch
=head1 DESCRIPTION
Run the fibu3 syncer
Run the logfetcher
=cut

Expand All @@ -27,7 +27,6 @@ usage: $0 fetch [OPTIONS]
These options are available:
--verbose talk about your work
--noaction do not actually write to the rrd files
EOF

Expand All @@ -40,8 +39,9 @@ has cfg => sub { shift->app->config->cfgHash };
sub run {
my $self = shift;
local @ARGV = @_ if scalar @_;
GetOptions(\%opt, 'daemon|d', 'noaction|no-action|n', 'verbose|v');
GetOptions(\%opt, 'verbose|v');
if ($opt{verbose}){
$ENV{MOJO_LOG_LEVEL} = 'debug';
$self->log->level('debug');
$self->log->handle(\*STDOUT);
}
Expand Down Expand Up @@ -106,7 +106,7 @@ S<Tobias Oetiker E<lt>tobi@oetiker.chE<gt>>
=head1 HISTORY
2011-05-30 to 1.0 first version
2015-05-30 to 1.0 first version
=cut
Expand Down
10 changes: 8 additions & 2 deletions lib/LogFetcher/HostChannel.pm
Expand Up @@ -408,7 +408,10 @@ sub makeHostChannel {
}
my ($id,$time,$file) = ($2,$3,$4);
if (my $minAge = $self->logFiles->[$id]{minAge}){
next if time - $time <= $minAge;
if (time - $time <= $minAge){
$self->log->debug($self->name.": skipping $file as is not $minAge seconds old");
next;
}
}
my %match = (
RXMATCH_1 => '',
Expand All @@ -418,7 +421,10 @@ sub makeHostChannel {
RXMATCH_5 => '',
);
if (my $filter = $self->logFiles->[$id]{filterRegexp}){
next if $file !~ $filter;
if ($file !~ $filter){
$self->log->debug($self->name.": skipping $file as it does not match filterRexexp /$filter/");
next;
}
%match = (
RXMATCH_1 => $1 // '',
RXMATCH_2 => $2 // '',
Expand Down

0 comments on commit 9540ef7

Please sign in to comment.