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

Make Xcode happy

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