You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/10/31 16:18:24 UTC
[05/17] git commit: TS-2302: rename LoggingMode values for improved
clarity
TS-2302: rename LoggingMode values for improved clarity
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/bb7fc366
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/bb7fc366
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/bb7fc366
Branch: refs/heads/master
Commit: bb7fc3662b09c7a8147205f442f69ba16deaad7e
Parents: c2452f5
Author: James Peach <jp...@apache.org>
Authored: Tue Sep 24 10:29:14 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu Oct 31 08:16:27 2013 -0700
----------------------------------------------------------------------
proxy/logging/Log.cc | 16 ++++++++--------
proxy/logging/Log.h | 30 +++++++++++++++---------------
proxy/logging/LogConfig.cc | 2 +-
3 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb7fc366/proxy/logging/Log.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 411e67b..a74c826 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -69,7 +69,7 @@ LogConfig *Log::config = NULL;
LogFieldList Log::global_field_list;
LogFormat *Log::global_scrap_format = NULL;
LogObject *Log::global_scrap_object = NULL;
-Log::LoggingMode Log::logging_mode = LOG_NOTHING;
+Log::LoggingMode Log::logging_mode = LOG_MODE_NONE;
// Inactive objects
LogObject **Log::inactive_objects;
@@ -240,8 +240,8 @@ Log::periodic_tasks(long time_now)
if (logging_mode_changed) {
int val = (int) REC_ConfigReadInteger("proxy.config.log.logging_enabled");
- if (val<LOG_NOTHING || val> FULL_LOGGING) {
- logging_mode = FULL_LOGGING;
+ if (val<LOG_MODE_NONE || val> LOG_MODE_FULL) {
+ logging_mode = LOG_MODE_FULL;
Warning("proxy.config.log.logging_enabled has an invalid " "value setting it to %d", logging_mode);
} else {
logging_mode = (LoggingMode) val;
@@ -252,7 +252,7 @@ Log::periodic_tasks(long time_now)
// so that log objects are flushed
//
change_configuration();
- } else if (logging_mode > LOG_NOTHING || config->collation_mode == LogConfig::COLLATION_HOST ||
+ } else if (logging_mode > LOG_MODE_NONE || config->collation_mode == LogConfig::COLLATION_HOST ||
config->has_api_objects()) {
Debug("log-periodic", "Performing periodic tasks");
@@ -933,7 +933,7 @@ Log::init(int flags)
// set the logging_mode and read config variables if needed
//
if (config_flags & LOGCAT) {
- logging_mode = LOG_NOTHING;
+ logging_mode = LOG_MODE_NONE;
} else {
log_rsb = RecAllocateRawStatBlock((int) log_stat_count);
LogConfig::register_stat_callbacks();
@@ -943,11 +943,11 @@ Log::init(int flags)
collation_preproc_threads = config->collation_preproc_threads;
if (config_flags & STANDALONE_COLLATOR) {
- logging_mode = LOG_TRANSACTIONS_ONLY;
+ logging_mode = LOG_MODE_TRANSACTIONS;
} else {
int val = (int) REC_ConfigReadInteger("proxy.config.log.logging_enabled");
- if (val < LOG_NOTHING || val > FULL_LOGGING) {
- logging_mode = FULL_LOGGING;
+ if (val < LOG_MODE_NONE || val > LOG_MODE_FULL) {
+ logging_mode = LOG_MODE_FULL;
Warning("proxy.config.log.logging_enabled has an invalid "
"value, setting it to %d", logging_mode);
} else {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb7fc366/proxy/logging/Log.h
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.h b/proxy/logging/Log.h
index 6bfc689..07485d9 100644
--- a/proxy/logging/Log.h
+++ b/proxy/logging/Log.h
@@ -116,7 +116,7 @@
be needed will be taken. The data is then marshalled into the
buffer previously allocated.
- - The LogBuffer is composed of two parts: a fixed-size part that
+ - The LogBuffer is composed of two parts: a fixed-size part that
contains all of the statically-sized fields, and a variable-sized
buffer that follows, containing all of the space for strings.
Variable-size fields in the LogBuffer are actually just
@@ -143,14 +143,14 @@
+-+---------------+
|h|bbb|b|bbbb|bbb |
+-+---------------+
- |
- | ********** +---------------+
- +-?-> * format * ---> |abcdefghijklmno| ---> DISK
- | ********** +---------------+
- |
- +-?-> DISK
- |
- +-?-> NETWORK
+ |
+ | ********** +---------------+
+ +-?-> * format * ---> |abcdefghijklmno| ---> DISK
+ | ********** +---------------+
+ |
+ +-?-> DISK
+ |
+ +-?-> NETWORK
- The logging thread wakes up whenever there is a LogBufferSegment
ready to be flushed. This occurs when it is on the full_segment
@@ -365,10 +365,10 @@ public:
enum LoggingMode
{
- LOG_NOTHING = 0,
- LOG_ERRORS_ONLY,
- LOG_TRANSACTIONS_ONLY,
- FULL_LOGGING
+ LOG_MODE_NONE = 0,
+ LOG_MODE_ERRORS, // log *only* errors
+ LOG_MODE_TRANSACTIONS, // log *only* transactions
+ LOG_MODE_FULL
};
enum InitFlags
@@ -391,12 +391,12 @@ public:
static void init_fields();
inkcoreapi static bool transaction_logging_enabled()
{
- return (logging_mode == FULL_LOGGING || logging_mode == LOG_TRANSACTIONS_ONLY);
+ return (logging_mode == LOG_MODE_FULL || logging_mode == LOG_MODE_TRANSACTIONS);
}
inkcoreapi static bool error_logging_enabled()
{
- return (logging_mode == FULL_LOGGING || logging_mode == LOG_ERRORS_ONLY);
+ return (logging_mode == LOG_MODE_FULL || logging_mode == LOG_MODE_ERRORS);
}
inkcoreapi static int access(LogAccess * lad);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb7fc366/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index aa874d5..355f153 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -475,7 +475,7 @@ LogConfig::read_configuration_variables()
/* variable values from records.config */
val = (int) REC_ConfigReadInteger("proxy.config.log.search_log_enabled");
- if (Log::logging_mode == Log::FULL_LOGGING)
+ if (Log::logging_mode == Log::LOG_MODE_FULL)
search_log_enabled = (val > 0);
/* */