67 lines
2.4 KiB
C++
67 lines
2.4 KiB
C++
|
|
|
|
|
|
#ifndef LOGGING_LOGGINGBASE_H_
|
|
#define LOGGING_LOGGINGBASE_H_
|
|
|
|
namespace logging {
|
|
|
|
template<typename Dummy>
|
|
class _PermitionsBase {
|
|
public:
|
|
enum LOG_PERMIT_FLAG {
|
|
__PERMISSIONS_MASK = 0xFFFFu
|
|
};
|
|
|
|
/* Разрешить работы журнала критических сообщений. */
|
|
static const LOG_PERMIT_FLAG on_critical_log = static_cast<LOG_PERMIT_FLAG>(0x01);
|
|
/* Разрешить работы журнала ошибок сообщений. */
|
|
static const LOG_PERMIT_FLAG on_error_log = static_cast<LOG_PERMIT_FLAG>(0x02);
|
|
/* Разрешить работы журнала информационных сообщений. */
|
|
static const LOG_PERMIT_FLAG on_information_log = static_cast<LOG_PERMIT_FLAG>(0x04);
|
|
/* Разрешить работу всех журналов сообщений. */
|
|
static const LOG_PERMIT_FLAG on_all_logs = static_cast<LOG_PERMIT_FLAG>(0x07);
|
|
|
|
enum RECORD_PRIORITY_FLAG {
|
|
__PRIORITY_MASK = 0x3
|
|
};
|
|
|
|
static const RECORD_PRIORITY_FLAG hi_record_priority = static_cast<RECORD_PRIORITY_FLAG>(0x3);
|
|
static const RECORD_PRIORITY_FLAG medium_record_priority = static_cast<RECORD_PRIORITY_FLAG>(0x2);
|
|
static const RECORD_PRIORITY_FLAG low_record_priority = static_cast<RECORD_PRIORITY_FLAG>(0x1);
|
|
};
|
|
|
|
template <typename Dummy>
|
|
const typename _PermitionsBase<Dummy>::LOG_PERMIT_FLAG _PermitionsBase<Dummy>::on_critical_log;
|
|
|
|
template <typename Dummy>
|
|
const typename _PermitionsBase<Dummy>::LOG_PERMIT_FLAG _PermitionsBase<Dummy>::on_all_logs;
|
|
|
|
template <typename Dummy>
|
|
const typename _PermitionsBase<Dummy>::LOG_PERMIT_FLAG _PermitionsBase<Dummy>::on_information_log;
|
|
|
|
template <typename Dummy>
|
|
const typename _PermitionsBase<Dummy>::LOG_PERMIT_FLAG _PermitionsBase<Dummy>::on_error_log;
|
|
|
|
template <typename Dummy>
|
|
const typename _PermitionsBase<Dummy>::RECORD_PRIORITY_FLAG _PermitionsBase<Dummy>::hi_record_priority;
|
|
|
|
template <typename Dummy>
|
|
const typename _PermitionsBase<Dummy>::RECORD_PRIORITY_FLAG _PermitionsBase<Dummy>::medium_record_priority;
|
|
template <typename Dummy>
|
|
const typename _PermitionsBase<Dummy>::RECORD_PRIORITY_FLAG _PermitionsBase<Dummy>::low_record_priority;
|
|
|
|
class base : public _PermitionsBase<uint16_t> {
|
|
public:
|
|
typedef uint16_t log_permit_flag;
|
|
typedef uint16_t record_priority;
|
|
typedef uint16_t record_sender_index;
|
|
|
|
base(const base&) = delete;
|
|
base& operator=(const base&) = delete;
|
|
};
|
|
|
|
}
|
|
|
|
#endif //LOGGING_LOGGINGBASE_H_
|