Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. More...
#include <string>
#include <atscppapi/noncopyable.h>
Go to the source code of this file.
Data Structures | |
class | atscppapi::Logger |
Create log files that are automatically rolled and cleaned up as space is required. More... | |
Namespaces | |
namespace | atscppapi |
Defines | |
#define | ATSCPPAPI_PRINTFLIKE(fmt, arg) |
#define | LOG_DEBUG(log, fmt,...) |
A helper macro for Logger objects that allows you to easily add a debug level message which will include file, line, and function name with the message. | |
#define | LOG_INFO(log, fmt,...) |
A helper macro for Logger objects that allows you to easily add a info level message which will include file, line, and function name with the message. | |
#define | LOG_ERROR(log, fmt,...) |
A helper macro for Logger objects that allows you to easily add a error level message which will include file, line, and function name with the message. | |
#define | STRINGIFY0(x) #x |
#define | STRINGIFY(x) STRINGIFY0(x) |
#define | LINE_NO STRINGIFY(__LINE__) |
#define | TS_DEBUG(tag, fmt,...) |
A helper macro to get access to the Diag messages available in traffic server. | |
#define | TS_ERROR(tag, fmt,...) |
A helper macro to get access to the error.log messages available in traffic server. |
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Helpers and Classes related to Logging
Definition in file Logger.h.
#define LOG_DEBUG | ( | log, | ||
fmt, | ||||
... | ||||
) |
do { \ (log).logDebug("[%s:%d, %s()] " fmt, __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \ } while (false)
A helper macro for Logger objects that allows you to easily add a debug level message which will include file, line, and function name with the message.
It's very easy to use:
// Suppose you have already created a Logger named logger: LOG_DEBUG(logger, "This is a test DEBUG message: %s", "hello"); // Outputs [file.cc:125, function()] [DEBUG] This is a test DEBUG message: hello.
#define LOG_ERROR | ( | log, | ||
fmt, | ||||
... | ||||
) |
do { \ (log).logError("[%s:%d, %s()] " fmt, __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \ } while (false)
A helper macro for Logger objects that allows you to easily add a error level message which will include file, line, and function name with the message.
See example in LOG_DEBUG
#define LOG_INFO | ( | log, | ||
fmt, | ||||
... | ||||
) |
do { \ (log).logInfo("[%s:%d, %s()] " fmt, __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \ } while (false)
A helper macro for Logger objects that allows you to easily add a info level message which will include file, line, and function name with the message.
See example in LOG_DEBUG
#define TS_DEBUG | ( | tag, | ||
fmt, | ||||
... | ||||
) |
do { \ TSDebug(tag "." __FILE__ ":" LINE_NO , "[%s()] " fmt, __FUNCTION__, ## __VA_ARGS__); \ } while (false)
A helper macro to get access to the Diag messages available in traffic server.
These can be enabled via traffic_server -T "tag.*" or since this macro includes the file can you further refine to an individual file or even a particular line! This can also be enabled via records.config.
#define TS_ERROR | ( | tag, | ||
fmt, | ||||
... | ||||
) |
do { \ TS_DEBUG(tag, "[ERROR] " fmt, ## __VA_ARGS__); \ TSError("[%s] [%s:%d, %s()] " fmt, tag, __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \ } while (false)
A helper macro to get access to the error.log messages available in traffic server.
This will also output a DEBUG message visible via traffic_server -T "tag.*", or by enabling the tag in records.config.
Definition at line 122 of file Logger.h.
Referenced by SDK_API_TSConstant(), SDK_API_TSHttpHdr(), SDK_API_TSMimeHdrField(), SDK_API_TSMimeHdrParse(), SDK_API_TSPortDescriptor(), SDK_API_TSUrl(), SDK_API_TSUrlParse(), sdk_sanity_check_mbuffer(), TSHandleMLocRelease(), TSHttpTxnCachedRespTimeGet(), TSHttpTxnCacheLookupUrlGet(), TSHttpTxnConfigFind(), TSHttpTxnNewCacheLookupDo(), TSHttpTxnRedirectRequest(), TSHttpTxnSecondUrlTryLock(), TSHttpTxnServerRespIgnore(), TSHttpTxnUpdateCachedObject(), TSICPCachedReqGet(), TSICPCachedRespGet(), TSMimeHdrFieldValueDateInsert(), and TSMutexLockTry().