Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
3832f75c
Commit
3832f75c
authored
Apr 16, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print errors and warning if compiled w/o logging
parent
8be5138a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
cppa/logging.hpp
cppa/logging.hpp
+7
-8
No files found.
cppa/logging.hpp
View file @
3832f75c
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#define CPPA_LOGGING_HPP
#define CPPA_LOGGING_HPP
#include <sstream>
#include <sstream>
#include <iostream>
#include "cppa/singletons.hpp"
#include "cppa/singletons.hpp"
#include "cppa/detail/demangle.hpp"
#include "cppa/detail/demangle.hpp"
...
@@ -106,7 +107,9 @@ class logging {
...
@@ -106,7 +107,9 @@ class logging {
#define CPPA_VOID_STMT static_cast<void>(0)
#define CPPA_VOID_STMT static_cast<void>(0)
#ifndef CPPA_LOG_LEVEL
#ifndef CPPA_LOG_LEVEL
# define CPPA_LOG(classname, funname, level, message) CPPA_VOID_STMT
# define CPPA_LOG(classname, funname, level, message) \
std::cerr << level << " [" << classname << "::" << funname << "]: " \
<< message << std::endl;
# define CPPA_LIF(stmt, logstmt) CPPA_VOID_STMT
# define CPPA_LIF(stmt, logstmt) CPPA_VOID_STMT
#else
#else
# define CPPA_LOG(classname, funname, level, message) { \
# define CPPA_LOG(classname, funname, level, message) { \
...
@@ -119,22 +122,18 @@ class logging {
...
@@ -119,22 +122,18 @@ class logging {
#define CPPA_CLASS_NAME ::cppa::detail::demangle(typeid(*this)).c_str()
#define CPPA_CLASS_NAME ::cppa::detail::demangle(typeid(*this)).c_str()
// errors and warnings are enabled by default
/**
/**
* @brief Logs a custom error message @p msg with class name @p cname
* @brief Logs a custom error message @p msg with class name @p cname
* and function name @p fname.
* and function name @p fname.
*/
*/
#define CPPA_LOGC_ERROR(cname, fname, msg) CPPA_LOG(cname, fname, "ERROR", msg)
#define CPPA_LOGC_ERROR(cname, fname, msg) CPPA_LOG(cname, fname, "ERROR", msg)
#define CPPA_LOGC_WARNING(cname, fname, msg) CPPA_
VOID_STMT
#define CPPA_LOGC_WARNING(cname, fname, msg) CPPA_
LOG(cname, fname, "WARN ", msg)
#define CPPA_LOGC_INFO(cname, fname, msg) CPPA_VOID_STMT
#define CPPA_LOGC_INFO(cname, fname, msg) CPPA_VOID_STMT
#define CPPA_LOGC_DEBUG(cname, fname, msg) CPPA_VOID_STMT
#define CPPA_LOGC_DEBUG(cname, fname, msg) CPPA_VOID_STMT
#define CPPA_LOGC_TRACE(cname, fname, msg) CPPA_VOID_STMT
#define CPPA_LOGC_TRACE(cname, fname, msg) CPPA_VOID_STMT
// enable warnings
#if CPPA_LOG_LEVEL > 0
# undef CPPA_LOGC_WARNING
# define CPPA_LOGC_WARNING(cname, fname, msg) CPPA_LOG(cname, fname, "WARN ", msg)
#endif
// enable info messages
// enable info messages
#if CPPA_LOG_LEVEL > 1
#if CPPA_LOG_LEVEL > 1
# undef CPPA_LOGC_INFO
# undef CPPA_LOGC_INFO
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment