提交 989d400c authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Make Xcode happy

上级 704cb4c2
......@@ -2,6 +2,7 @@
# gyp generated stuff
/worker/out/
/worker/**/*.xcodeproj/
# Others
/npm-debug.log
......
......@@ -5,9 +5,9 @@
enum class LogLevel : uint8_t
{
DEBUG = 2,
WARN = 1,
ERROR = 0
LOG_DEBUG = 2,
LOG_WARN = 1,
LOG_ERROR = 0
};
#endif
......@@ -56,7 +56,7 @@ public:
inline
bool Logger::HasDebugLevel()
{
return (LogLevel::DEBUG == Settings::configuration.logLevel);
return (LogLevel::LOG_DEBUG == Settings::configuration.logLevel);
}
// NOTE: Each file including Logger.h MUST define its own MS_CLASS macro.
......@@ -97,7 +97,7 @@ bool Logger::HasDebugLevel()
#define MS_DEBUG(desc, ...) \
do \
{ \
if (LogLevel::DEBUG == Settings::configuration.logLevel) \
if (LogLevel::LOG_DEBUG == Settings::configuration.logLevel) \
{ \
int ms_logger_written = std::snprintf(Logger::buffer, MS_LOGGER_BUFFER_SIZE, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, ms_logger_written); \
......@@ -108,7 +108,7 @@ bool Logger::HasDebugLevel()
#define MS_DEBUG_STD(desc, ...) \
do \
{ \
if (LogLevel::DEBUG == Settings::configuration.logLevel) \
if (LogLevel::LOG_DEBUG == Settings::configuration.logLevel) \
{ \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stdout); \
......@@ -119,7 +119,7 @@ bool Logger::HasDebugLevel()
#define MS_WARN(desc, ...) \
do \
{ \
if (LogLevel::WARN <= Settings::configuration.logLevel) \
if (LogLevel::LOG_WARN <= Settings::configuration.logLevel) \
{ \
int ms_logger_written = std::snprintf(Logger::buffer, MS_LOGGER_BUFFER_SIZE, "W" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, ms_logger_written); \
......
......@@ -14,7 +14,7 @@ public:
// Struct holding the configuration.
struct Configuration
{
LogLevel logLevel { LogLevel::DEBUG };
LogLevel logLevel { LogLevel::LOG_DEBUG };
std::string rtcListenIPv4;
std::string rtcListenIPv6;
uint16_t rtcMinPort { 10000 };
......
......@@ -2,7 +2,6 @@
# File inspired in https://github.com/indutny/bud
import glob
import platform
import os
import subprocess
......@@ -54,6 +53,7 @@ if __name__ == '__main__':
# GYP bug.
# On msvs it will crash if it gets an absolute path.
# On Mac/make it will crash if it doesn't get an absolute path.
# NOTE ibc: Not sure that it requires absolute path in Mac/make...
if sys.platform == 'win32':
args.append(os.path.join(root, 'mediasoup-worker.gyp'))
common_fn = os.path.join(root, 'common.gypi')
......
......@@ -26,15 +26,15 @@ bool IsBindableIP(const std::string &ip, int family, int* _bind_err);
struct Settings::Configuration Settings::configuration;
std::map<std::string, LogLevel> Settings::string2LogLevel =
{
{ "debug", LogLevel::DEBUG },
{ "warn", LogLevel::WARN },
{ "error", LogLevel::ERROR }
{ "debug", LogLevel::LOG_DEBUG },
{ "warn", LogLevel::LOG_WARN },
{ "error", LogLevel::LOG_ERROR }
};
std::map<LogLevel, std::string> Settings::logLevel2String =
{
{ LogLevel::DEBUG, "debug" },
{ LogLevel::WARN, "warn" },
{ LogLevel::ERROR, "error" }
{ LogLevel::LOG_DEBUG, "debug" },
{ LogLevel::LOG_WARN, "warn" },
{ LogLevel::LOG_ERROR, "error" }
};
/* Class methods. */
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论