Skip to content

Commit

Permalink
Fixed #593: Warn if logging is disabled at compile time but requested…
Browse files Browse the repository at this point in the history
… at runtime
  • Loading branch information
hkaiser committed Oct 30, 2012
1 parent 3ecaeb1 commit 215df9e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 1 addition & 3 deletions hpx/util/logging.hpp
Expand Up @@ -176,9 +176,7 @@ namespace hpx { namespace util { namespace detail
// well
struct init_logging
{
init_logging(runtime_configuration&, bool, naming::resolver_client&)
{
}
init_logging(runtime_configuration&, bool, naming::resolver_client&);
};

struct dummy_log_impl {};
Expand Down
18 changes: 18 additions & 0 deletions src/util/logging.cpp
Expand Up @@ -960,6 +960,24 @@ namespace hpx { namespace util { namespace detail
static std::vector<std::string> dummy_data;
return dummy_data;
}

init_logging::init_logging(runtime_configuration& ini, bool,
naming::resolver_client&)
{
// warn if logging is requested

if (ini.get_entry("hpx.logging.level", "0") != "0" ||
ini.get_entry("hpx.logging.timing.level", "0") != "0" ||
ini.get_entry("hpx.logging.agas.level", "0") != "0" ||
ini.get_entry("hpx.logging.application.level", "0") != "0")
{
std::cerr << "hpx::init_logging: warning: logging is requested even "
"if it has has been disabled at compile time. If you "
"need logging to be functional, please reconfigure and "
"rebuild HPX with HPX_NO_LOGGING set to OFF."
<< endl;
}
}
}}}

#endif // HPX_NO_LOGGING

0 comments on commit 215df9e

Please sign in to comment.