Skip to content

Commit

Permalink
Reporter: revert to old log prefix format
Browse files Browse the repository at this point in the history
  • Loading branch information
stdweird committed Oct 5, 2015
1 parent f0ddde7 commit 64ab71f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/main/perl/Reporter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ sub info
{
my $self = shift;
$self->syslog ('info', @_);
return $self->report('[INFO] ', @_);
return $self->report('[INFO] ', @_);
}


Expand All @@ -242,7 +242,7 @@ sub OK
{
my $self = shift;
$self->syslog('notice', @_);
return $self->report('[OK] ', @_);
return $self->report('[OK] ', @_);
}


Expand All @@ -260,7 +260,7 @@ sub warn
{
my $self = shift;
$self->syslog('warning', @_);
return $self->report('[WARN] ', @_);
return $self->report('[WARN] ', @_);
}

=pod
Expand Down Expand Up @@ -299,7 +299,7 @@ sub verbose

if ($self->_rep_setup()->{$VERBOSE}) {
$self->syslog ('notice', @_);
return $self->report('[VERB] ', @_);
return $self->report('[VERB] ', @_);
}

return SUCCESS;
Expand Down
8 changes: 4 additions & 4 deletions src/test/perl/reporter.t
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ $mock->mock('report', sub { shift; $reported = \@_; return SUCCESS;});
$myrep->init_reporter();

is($myrep->info('hello', 'info'), SUCCESS, 'info returns success');
is_deeply($reported, ['[INFO] ', 'hello', 'info'], 'info calls report with prefix and args');
is_deeply($reported, ['[INFO] ', 'hello', 'info'], 'info calls report with prefix and args');
is_deeply($syslogged, ['info', 'hello', 'info'], 'info calls syslogs with info priority and args');

is($myrep->OK('hello', 'ok'), SUCCESS, 'OK returns success');
is_deeply($reported, ['[OK] ', 'hello', 'ok'], 'OK calls report with prefix and args');
is_deeply($reported, ['[OK] ', 'hello', 'ok'], 'OK calls report with prefix and args');
is_deeply($syslogged, ['notice', 'hello', 'ok'], 'OK calls syslogs with notice priority and args');

is($myrep->warn('hello', 'warn'), SUCCESS, 'warn returns success');
is_deeply($reported, ['[WARN] ', 'hello', 'warn'], 'warn calls report with prefix and args');
is_deeply($reported, ['[WARN] ', 'hello', 'warn'], 'warn calls report with prefix and args');
is_deeply($syslogged, ['warning', 'hello', 'warn'], 'warn calls syslogs with warning priority and args');

is($myrep->error('hello', 'error'), SUCCESS, 'error returns success');
Expand All @@ -232,7 +232,7 @@ is($CAF::Reporter::_REP_SETUP->{$VERBOSE}, 1, "Verbose enabled");
$reported = undef;
$syslogged = undef;
is($myrep->verbose('hello', 'verbose', 'enabled'), SUCCESS, 'verbose returns success with verbose enabled');
is_deeply($reported, ['[VERB] ', 'hello', 'verbose', 'enabled'],
is_deeply($reported, ['[VERB] ', 'hello', 'verbose', 'enabled'],
'verbose calls report with prefix and args with verbose enabled');
is_deeply($syslogged, ['notice', 'hello', 'verbose', 'enabled'],
'verbose calls syslogs with notice priority and args with verbose verbose enabled');
Expand Down

0 comments on commit 64ab71f

Please sign in to comment.