Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow OCL::logging::Category to be property overriden #92

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 1 addition & 55 deletions logging/Category.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,60 +30,6 @@ void Category::log(log4cpp::Priority::Value priority,
}
}

void Category::debug(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::DEBUG))
_logUnconditionally2(log4cpp::Priority::DEBUG, message);
}

void Category::info(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::INFO))
_logUnconditionally2(log4cpp::Priority::INFO, message);
}

void Category::notice(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::NOTICE))
_logUnconditionally2(log4cpp::Priority::NOTICE, message);
}

void Category::warn(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::WARN))
_logUnconditionally2(log4cpp::Priority::WARN, message);
}

void Category::error(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::ERROR))
_logUnconditionally2(log4cpp::Priority::ERROR, message);
}

void Category::crit(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::CRIT))
_logUnconditionally2(log4cpp::Priority::CRIT, message);
}

void Category::alert(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::ALERT))
_logUnconditionally2(log4cpp::Priority::ALERT, message);
}

void Category::emerg(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::EMERG))
_logUnconditionally2(log4cpp::Priority::EMERG, message);
}

void Category::fatal(const RTT::rt_string& message) throw()
{
if (isPriorityEnabled(log4cpp::Priority::FATAL))
_logUnconditionally2(log4cpp::Priority::FATAL, message);
}


void Category::_logUnconditionally2(log4cpp::Priority::Value priority,
const RTT::rt_string& message) throw()
Expand Down Expand Up @@ -149,7 +95,7 @@ log4cpp::Category* Category::createOCLCategory(const std::string& name,

CategoryStream Category::getRTStream(log4cpp::Priority::Value priority)
{
return CategoryStream(this, isPriorityEnabled(priority) ?
return CategoryStream(this, isPriorityEnabled(priority) ?
priority : log4cpp::Priority::NOTSET);
}

Expand Down
18 changes: 9 additions & 9 deletions logging/Category.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ class Category : public log4cpp::Category
public:
virtual void log(log4cpp::Priority::Value priority,
const RTT::rt_string& message) throw();
void debug(const RTT::rt_string& message) throw();
void info(const RTT::rt_string& message) throw();
void notice(const RTT::rt_string& message) throw();
void warn(const RTT::rt_string& message) throw();
void error(const RTT::rt_string& message) throw();
void crit(const RTT::rt_string& message) throw();
void alert(const RTT::rt_string& message) throw();
void emerg(const RTT::rt_string& message) throw();
void fatal(const RTT::rt_string& message) throw();
void debug(const RTT::rt_string& message) throw() { log(log4cpp::Priority::DEBUG, message); }
void info(const RTT::rt_string& message) throw() { log(log4cpp::Priority::INFO, message); }
void notice(const RTT::rt_string& message) throw() { log(log4cpp::Priority::NOTICE, message); }
void warn(const RTT::rt_string& message) throw() { log(log4cpp::Priority::WARN, message); }
void error(const RTT::rt_string& message) throw() { log(log4cpp::Priority::ERROR, message); }
void crit(const RTT::rt_string& message) throw() { log(log4cpp::Priority::CRIT, message); }
void alert(const RTT::rt_string& message) throw() { log(log4cpp::Priority::ALERT, message); }
void emerg(const RTT::rt_string& message) throw() { log(log4cpp::Priority::EMERG, message); }
void fatal(const RTT::rt_string& message) throw() { log(log4cpp::Priority::FATAL, message); }

/**
* Returns a stream-like object into which you can log
Expand Down