const char *fileName,
int line,
const char *function) = 0;
- virtual void SecureDebug(const char *message,
- const char *fileName,
- int line,
- const char *function) = 0;
- virtual void SecureInfo(const char *message,
- const char *fileName,
- int line,
- const char *function) = 0;
- virtual void SecureWarning(const char *message,
- const char *fileName,
- int line,
- const char *function) = 0;
- virtual void SecureError(const char *message,
- const char *fileName,
- int line,
- const char *function) = 0;
protected:
static const char *LocateSourceFileName(const char *filename);
};
const char *fileName,
int line,
const char *function);
- virtual void SecureDebug(const char *message,
- const char *fileName,
- int line,
- const char *function);
- virtual void SecureInfo(const char *message,
- const char *fileName,
- int line,
- const char *function);
- virtual void SecureWarning(const char *message,
- const char *fileName,
- int line,
- const char *function);
- virtual void SecureError(const char *message,
- const char *fileName,
- int line,
- const char *function);
// Set global Tag according to DLOG
void SetTag(const char *tag);
};
const char *function);
/**
- * Log pedantic message with secure macro
- */
- void SecureDebug(const char *message,
- const char *filename,
- int line,
- const char *function);
-
- /**
- * Log info message with secure macro
- */
- void SecureInfo(const char *message,
- const char *filename,
- int line,
- const char *function);
-
- /**
- * Log warning message with secure macro
- */
- void SecureWarning(const char *message,
- const char *filename,
- int line,
- const char *function);
-
- /**
- * Log error message with secure macro
- */
- void SecureError(const char *message,
- const char *filename,
- int line,
- const char *function);
-
- /**
* Set default's DLOG provider Tag
*/
void SetTag(const char *tag);
/* Errors must be always logged. */
#define LogError(message) DPL_MACRO_FOR_LOGGING(message, Error)
-#define LogSecureError(message) DPL_MACRO_FOR_LOGGING(message, SecureError)
#ifdef BUILD_TYPE_DEBUG
#define LogDebug(message) DPL_MACRO_FOR_LOGGING(message, Debug)
#define LogInfo(message) DPL_MACRO_FOR_LOGGING(message, Info)
#define LogWarning(message) DPL_MACRO_FOR_LOGGING(message, Warning)
#define LogPedantic(message) DPL_MACRO_FOR_LOGGING(message, Pedantic)
- #define LogSecureDebug(message) DPL_MACRO_FOR_LOGGING(message, SecureDebug)
- #define LogSecureInfo(message) DPL_MACRO_FOR_LOGGING(message, SecureInfo)
- #define LogSecureWarning(message) DPL_MACRO_FOR_LOGGING(message, SecureWarning)
#else
#define LogDebug(message) DPL_MACRO_DUMMY_LOGGING(message, Debug)
#define LogInfo(message) DPL_MACRO_DUMMY_LOGGING(message, Info)
#define LogWarning(message) DPL_MACRO_DUMMY_LOGGING(message, Warning)
#define LogPedantic(message) DPL_MACRO_DUMMY_LOGGING(message, Pedantic)
- #define LogSecureDebug(message) DPL_MACRO_DUMMY_LOGGING(message, SecureDebug)
- #define LogSecureInfo(message) DPL_MACRO_DUMMY_LOGGING(message, SecureInfo)
- #define LogSecureWarning(message) DPL_MACRO_DUMMY_LOGGING(message, SecureWarning)
#endif // BUILD_TYPE_DEBUG
#endif // CENT_KEY_LOG_H
const char *fileName,
int line,
const char *function);
- virtual void SecureDebug(const char *message,
- const char *fileName,
- int line,
- const char *function);
- virtual void SecureInfo(const char *message,
- const char *fileName,
- int line,
- const char *function);
- virtual void SecureWarning(const char *message,
- const char *fileName,
- int line,
- const char *function);
- virtual void SecureError(const char *message,
- const char *fileName,
- int line,
- const char *function);
};
}
} // namespace CKM
function).c_str());
}
-void DLOGLogProvider::SecureDebug(const char *message UNUSED,
- const char *filename UNUSED,
- int line UNUSED,
- const char *function UNUSED)
-{
- SECURE_SLOG(LOG_DEBUG, m_tag.get(), "%s",
- FormatMessage(message, filename, line, function).c_str());
-}
-
-void DLOGLogProvider::SecureInfo(const char *message UNUSED,
- const char *filename UNUSED,
- int line UNUSED,
- const char *function UNUSED)
-{
- SECURE_SLOG(LOG_INFO, m_tag.get(), "%s",
- FormatMessage(message, filename, line, function).c_str());
-}
-
-void DLOGLogProvider::SecureWarning(const char *message UNUSED,
- const char *filename UNUSED,
- int line UNUSED,
- const char *function UNUSED)
-{
- SECURE_SLOG(LOG_WARN, m_tag.get(), "%s",
- FormatMessage(message, filename, line, function).c_str());
-}
-
-void DLOGLogProvider::SecureError(const char *message UNUSED,
- const char *filename UNUSED,
- int line UNUSED,
- const char *function UNUSED)
-{
- SECURE_SLOG(LOG_ERROR, m_tag.get(), "%s",
- FormatMessage(message, filename, line, function).c_str());
-}
-
} // nemespace Log
} // namespace CKM
}
}
-void LogSystem::SecureInfo(const char *message,
- const char *filename,
- int line,
- const char *function)
-{
- for (AbstractLogProviderPtrList::iterator iterator = m_providers.begin();
- iterator != m_providers.end();
- ++iterator)
- {
- (*iterator)->SecureInfo(message, filename, line, function);
- }
-}
-
-void LogSystem::SecureDebug(const char *message,
- const char *filename,
- int line,
- const char *function)
-{
- for (AbstractLogProviderPtrList::iterator iterator = m_providers.begin();
- iterator != m_providers.end();
- ++iterator)
- {
- (*iterator)->SecureDebug(message, filename, line, function);
- }
-}
-
-void LogSystem::SecureError(const char *message,
- const char *filename,
- int line,
- const char *function)
-{
- for (AbstractLogProviderPtrList::iterator iterator = m_providers.begin();
- iterator != m_providers.end();
- ++iterator)
- {
- (*iterator)->SecureError(message, filename, line, function);
- }
-}
-
-void LogSystem::SecureWarning(const char *message,
- const char *filename,
- int line,
- const char *function)
-{
- for (AbstractLogProviderPtrList::iterator iterator = m_providers.begin();
- iterator != m_providers.end();
- ++iterator)
- {
- (*iterator)->SecureWarning(message, filename, line, function);
- }
-}
-
}
} // namespace CKM
}
}
-void OldStyleLogProvider::SecureDebug(const char *message,
- const char *filename,
- int line,
- const char *function)
-{
-#ifdef _SECURE_LOG
- if (m_showDebug) {
- if (m_printStdErr) {
- fprintf(stderr, "%s%s%s\n", DEBUG_BEGIN,
- FormatMessage(message, filename, line,
- function).c_str(), DEBUG_END);
- } else {
- fprintf(stdout, "%s%s%s\n", DEBUG_BEGIN,
- FormatMessage(message, filename, line,
- function).c_str(), DEBUG_END);
- }
- }
-#else
- (void)message;
- (void)filename;
- (void)line;
- (void)function;
-#endif
-}
-
-void OldStyleLogProvider::SecureInfo(const char *message,
- const char *filename,
- int line,
- const char *function)
-{
-#ifdef _SECURE_LOG
- if (m_showInfo) {
- if (m_printStdErr) {
- fprintf(stderr, "%s%s%s\n", INFO_BEGIN,
- FormatMessage(message, filename, line,
- function).c_str(), INFO_END);
- } else {
- fprintf(stdout, "%s%s%s\n", INFO_BEGIN,
- FormatMessage(message, filename, line,
- function).c_str(), INFO_END);
- }
- }
-#else
- (void)message;
- (void)filename;
- (void)line;
- (void)function;
-#endif
-}
-
-void OldStyleLogProvider::SecureWarning(const char *message,
- const char *filename,
- int line,
- const char *function)
-{
-#ifdef _SECURE_LOG
- if (m_showWarning) {
- if (m_printStdErr) {
- fprintf(stderr, "%s%s%s\n", WARNING_BEGIN,
- FormatMessage(message, filename, line,
- function).c_str(), WARNING_END);
- } else {
- fprintf(stdout, "%s%s%s\n", WARNING_BEGIN,
- FormatMessage(message, filename, line,
- function).c_str(), WARNING_END);
- }
- }
-#else
- (void)message;
- (void)filename;
- (void)line;
- (void)function;
-#endif
-}
-
-void OldStyleLogProvider::SecureError(const char *message,
- const char *filename,
- int line,
- const char *function)
-{
-#ifdef _SECURE_LOG
- if (m_showError) {
- if (m_printStdErr) {
- fprintf(stderr, "%s%s%s\n", ERROR_BEGIN,
- FormatMessage(message, filename, line,
- function).c_str(), ERROR_END);
- } else {
- fprintf(stdout, "%s%s%s\n", ERROR_BEGIN,
- FormatMessage(message, filename, line,
- function).c_str(), ERROR_END);
- }
- }
-#else
- (void)message;
- (void)filename;
- (void)line;
- (void)function;
-#endif
-}
-
}
} // namespace CKM