You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8 KiB
C

/***************************************************************************
* Copyright (C) 2009 by gempa GmbH *
* *
* All Rights Reserved. *
* *
* NOTICE: All information contained herein is, and remains *
* the property of gempa GmbH and its suppliers, if any. The intellectual *
* and technical concepts contained herein are proprietary to gempa GmbH *
* and its suppliers. *
* Dissemination of this information or reproduction of this material *
* is strictly forbidden unless prior written permission is obtained *
* from gempa GmbH. *
***************************************************************************/
#ifndef GEMPA_CAPS_LOG_H
#define GEMPA_CAPS_LOG_H
namespace Gempa {
namespace CAPS {
enum LogLevel {
LL_UNDEFINED = 0,
LL_ERROR,
LL_WARNING,
LL_NOTICE,
LL_INFO,
LL_DEBUG,
LL_QUANTITY
};
#define CAPS_LOG_MSG(LogLevel, ...) \
do {\
if ( Gempa::CAPS::LogHandler[LogLevel] != NULL )\
Gempa::CAPS::LogHandler[LogLevel](__VA_ARGS__);\
} while(0)
#define CAPS_ERROR(...) CAPS_LOG_MSG(Gempa::CAPS::LL_ERROR, __VA_ARGS__)
#define CAPS_WARNING(...) CAPS_LOG_MSG(Gempa::CAPS::LL_WARNING, __VA_ARGS__)
#define CAPS_NOTICE(...) CAPS_LOG_MSG(Gempa::CAPS::LL_NOTICE, __VA_ARGS__)
#define CAPS_INFO(...) CAPS_LOG_MSG(Gempa::CAPS::LL_INFO, __VA_ARGS__)
#define CAPS_DEBUG(...) CAPS_LOG_MSG(Gempa::CAPS::LL_DEBUG, __VA_ARGS__)
typedef void (*LogOutput)(const char *, ...);
extern LogOutput LogHandler[LL_QUANTITY];
void SetLogHandler(LogLevel, LogOutput);
}
}
#endif