diff options
| author | Alan Conway <aconway@apache.org> | 2007-06-27 00:12:26 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-06-27 00:12:26 +0000 |
| commit | d032f5584b0f1de890844a2796d6ba158b011fca (patch) | |
| tree | 7ffc500423a1cee3c39d2a5e27d301057fbcd0e9 /cpp/src/qpid/log | |
| parent | 2e15ee024a7f47bda7bd6ea5991657a820bd0714 (diff) | |
| download | qpid-python-d032f5584b0f1de890844a2796d6ba158b011fca.tar.gz | |
Make check now starts a broker on a dynamically assigned port, so
multiple qpid builds on one host will not conflict.
* src/tests/run_test, start_broker, kill_broker:
Broker writes port to file, run_test sets QPID_PORT
in environment of all tests.
* src/tests/topic_publisher.cpp, topic_listener.cpp, client_test.cpp:
All test clients use TestOptions to parse options from args and env.
* src/qpid/Options.h: Renamed from CommonOptions.h
Simplified use of Options class.
* src/qpid/Url.h: Renamed defaultPort constant.
* src/tests/logging.cpp:
* src/tests/interop_runner.cpp:
* src/tests/TestOptions.h:
* src/qpidd.cpp:
* src/qpid/log/Options.cpp:
* src/qpid/log/Logger.cpp:
* src/qpid/broker/Broker.cpp:
Updated for changes to Options.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@550993 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/log')
| -rw-r--r-- | cpp/src/qpid/log/Logger.cpp | 5 | ||||
| -rw-r--r-- | cpp/src/qpid/log/Options.cpp | 21 | ||||
| -rw-r--r-- | cpp/src/qpid/log/Options.h | 8 |
3 files changed, 16 insertions, 18 deletions
diff --git a/cpp/src/qpid/log/Logger.cpp b/cpp/src/qpid/log/Logger.cpp index 065d4508c7..ceb3977106 100644 --- a/cpp/src/qpid/log/Logger.cpp +++ b/cpp/src/qpid/log/Logger.cpp @@ -188,8 +188,11 @@ void Logger::remove(Statement& s) { statements.erase(&s); } -void Logger::configure(const Options& o, const std::string& prog) +void Logger::configure(const Options& opts, const std::string& prog) { + Options o(opts); + if (o.trace) + o.selectors.push_back("trace+"); { ScopedLock l(lock); syslogName=prog; diff --git a/cpp/src/qpid/log/Options.cpp b/cpp/src/qpid/log/Options.cpp index 3e117663ff..b15630ebb2 100644 --- a/cpp/src/qpid/log/Options.cpp +++ b/cpp/src/qpid/log/Options.cpp @@ -18,36 +18,34 @@ #include "Options.h" #include "Statement.h" -#include "qpid/CommonOptions.h" +#include "qpid/Options.h" namespace qpid { namespace log { using namespace std; -Options::Options() : - time(true), level(true), thread(false), source(false), function(false) +Options::Options(const std::string& name) : qpid::Options(name), + time(true), level(true), thread(false), source(false), function(false), trace(false) { outputs.push_back("stderr"); selectors.push_back("error+"); -} -void Options::addTo(po::options_description& desc) { - using namespace po; ostringstream levels; levels << LevelTraits::name(Level(0)); for (int i = 1; i < LevelTraits::COUNT; ++i) levels << " " << LevelTraits::name(Level(i)); - desc.add_options() + addOptions() + ("trace,t", optValue(trace), "Enable full debug tracing." ) ("log.enable", optValue(selectors, "RULE"), - "You can specify this option mutliple times.\n" + ("You can specify this option mutliple times.\n" "RULE is of the form 'LEVEL[+][:COMPONENT]'" - "Levels are: trace, debug, info, notice, warning, error, critical." + "Levels are: "+levels.str()+"\n" "For example:\n" "\t'--log.enable warning+' " "enables all warning, error and critical messages.\n" "\t'--log.enable debug:framing' " - "enables debug messages from the framing component.") + "enables debug messages from the framing component.").c_str()) ("log.output", optValue(outputs, "FILE"), "File to receive log output, or one of these special values: " "'stderr', 'stdout', 'syslog'.") @@ -61,9 +59,6 @@ void Options::addTo(po::options_description& desc) { "Include thread ID in log messages") ("log.function", optValue(function,"yes|no"), "Include function signature in log messages"); - } - - }} // namespace qpid::log diff --git a/cpp/src/qpid/log/Options.h b/cpp/src/qpid/log/Options.h index 39261c9b5d..441c6e8a8d 100644 --- a/cpp/src/qpid/log/Options.h +++ b/cpp/src/qpid/log/Options.h @@ -18,20 +18,20 @@ * limitations under the License. * */ -#include "qpid/CommonOptions.h" +#include "qpid/Options.h" namespace qpid { namespace log { /** Logging options for config parser. */ -struct Options { - Options(); - void addTo(po::options_description&); +struct Options : public qpid::Options { + Options(const std::string& name="Logging options"); std::vector<std::string> selectors; std::vector<std::string> outputs; bool time, level, thread, source, function; + bool trace; }; |
