Agora Server Gateway SDK C++ API Reference
IAgoraLog.h
Go to the documentation of this file.
1//
2// Agora Media SDK
3//
4// Copyright (c) 2015 Agora IO. All rights reserved.
5//
6#pragma once
7
8#include <cstdlib>
9#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
10#include <cstdint>
11#endif
12
13#ifndef OPTIONAL_ENUM_CLASS
14#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
15#define OPTIONAL_ENUM_CLASS enum class
16#else
17#define OPTIONAL_ENUM_CLASS enum
18#endif
19#endif
20
21#ifndef OPTIONAL_LOG_LEVEL_SPECIFIER
22#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
23#define OPTIONAL_LOG_LEVEL_SPECIFIER LOG_LEVEL::
24#else
25#define OPTIONAL_LOG_LEVEL_SPECIFIER
26#endif
27#endif
28
29namespace agora {
30namespace commons {
31
39 LOG_LEVEL_NONE = 0x0000,
43 LOG_LEVEL_INFO = 0x0001,
47 LOG_LEVEL_WARN = 0x0002,
51 LOG_LEVEL_ERROR = 0x0004,
55 LOG_LEVEL_FATAL = 0x0008,
56};
58/*
59 * @nodoc
60 */
61class ILogWriter {
62 public:
71 virtual int32_t writeLog(LOG_LEVEL level, const char* message, uint16_t length) = 0;
72
73 virtual ~ILogWriter() {}
74};
76
106
109 LOG_FILTER_MASK = 0x80f,
111};
112
113const uint32_t MAX_LOG_SIZE = 20 * 1024 * 1024; // 20MB
114const uint32_t MIN_LOG_SIZE = 128 * 1024; // 128KB
117const uint32_t DEFAULT_LOG_SIZE_IN_KB = 1024;
118
123{
127 const char* filePath;
131 uint32_t fileSizeInKB;
136
138};
139} //namespace commons
140} //namespace agora
141
142#undef OPTIONAL_LOG_LEVEL_SPECIFIER
#define OPTIONAL_ENUM_CLASS
Definition: IAgoraLog.h:17
#define OPTIONAL_LOG_LEVEL_SPECIFIER
Definition: IAgoraLog.h:25
const uint32_t MAX_LOG_SIZE
Definition: IAgoraLog.h:113
OPTIONAL_ENUM_CLASS LOG_LEVEL
Definition: IAgoraLog.h:35
const uint32_t MIN_LOG_SIZE
Definition: IAgoraLog.h:114
const uint32_t DEFAULT_LOG_SIZE_IN_KB
Definition: IAgoraLog.h:117
LOG_FILTER_TYPE
Definition: IAgoraLog.h:80
@ LOG_FILTER_CRITICAL
Definition: IAgoraLog.h:104
@ LOG_FILTER_DEBUG
Definition: IAgoraLog.h:88
@ LOG_FILTER_WARN
Definition: IAgoraLog.h:96
@ LOG_FILTER_INFO
Definition: IAgoraLog.h:92
@ LOG_FILTER_ERROR
Definition: IAgoraLog.h:100
@ LOG_FILTER_OFF
Definition: IAgoraLog.h:84
Definition: AgoraBase.h:86
Definition: IAgoraLog.h:123
LogConfig()
Definition: IAgoraLog.h:137
LOG_LEVEL level
Definition: IAgoraLog.h:135
uint32_t fileSizeInKB
Definition: IAgoraLog.h:131
const char * filePath
Definition: IAgoraLog.h:127