Skip to content

Commit

Permalink
logging: unify whitespace in Appender.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerj committed Jan 8, 2018
1 parent 29b49d1 commit 4d3f6ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
33 changes: 16 additions & 17 deletions logging/Appender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Appender::Appender(std::string name) :
ports()->addEventPort("LogPort", log_port );

properties()->addProperty(layoutName_prop);
properties()->addProperty(layoutPattern_prop);
properties()->addProperty(layoutPattern_prop);
properties()->addProperty(priorityThreshold_prop);
}

Expand All @@ -32,21 +32,20 @@ Appender::~Appender()

bool Appender::configureThreshold()
{
log4cpp::Priority::Value priority = log4cpp::Priority::NOTSET;
try
{
priority = log4cpp::Priority::getPriorityValue( boost::to_upper_copy( priorityThreshold_prop.rvalue() ) );

}
catch (std::invalid_argument)
{
// \todo more descriptive
RTT::Logger::In in(getName());
RTT::log(RTT::Error) << "Bad log4cpp priority: " << priorityThreshold_prop.rvalue() << RTT::endlog();
return false;
}
if (appender) appender->setThreshold(priority);
return true;
log4cpp::Priority::Value priority = log4cpp::Priority::NOTSET;
try
{
priority = log4cpp::Priority::getPriorityValue( boost::to_upper_copy( priorityThreshold_prop.rvalue() ) );
}
catch (std::invalid_argument)
{
// \todo more descriptive
RTT::Logger::In in(getName());
RTT::log(RTT::Error) << "Bad log4cpp priority: " << priorityThreshold_prop.rvalue() << RTT::endlog();
return false;
}
if (appender) appender->setThreshold(priority);
return true;
}

bool Appender::configureLayout()
Expand Down Expand Up @@ -94,7 +93,7 @@ bool Appender::startHook()
/// \todo input ports must be connected?
// return log_port.ready();
//
configureThreshold();
configureThreshold();

return true;
}
Expand Down
4 changes: 3 additions & 1 deletion logging/Appender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ class Appender : public RTT::TaskContext
successfully, otherwise false
*/
virtual bool configureLayout();

/** Set appender priority threshold.
*/
bool configureThreshold();
bool configureThreshold();

/// ensure port is connected before we start
virtual bool startHook();
/// Drain the buffer
Expand Down

0 comments on commit 4d3f6ab

Please sign in to comment.