Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
c03210af
提交
c03210af
authored
1月 03, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make new Logger properly work on worker test units
上级
6bf1dcdd
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
89 行增加
和
15 行删除
+89
-15
common.gypi
worker/common.gypi
+5
-5
Logger.h
worker/include/Logger.h
+80
-6
mediasoup-worker.gyp
worker/mediasoup-worker.gyp
+3
-3
Logger.cpp
worker/src/Logger.cpp
+1
-1
没有找到文件。
worker/common.gypi
浏览文件 @
c03210af
...
@@ -37,8 +37,8 @@
...
@@ -37,8 +37,8 @@
'xcode_settings':
'xcode_settings':
{
{
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
# -Wnewline-eof
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
'PREBINDING': 'NO',
# No -Wl,-prebind
'PREBINDING': 'NO', # No -Wl,-prebind
'OTHER_CFLAGS':
'OTHER_CFLAGS':
[
[
'-fstrict-aliasing',
'-fstrict-aliasing',
...
@@ -57,10 +57,10 @@
...
@@ -57,10 +57,10 @@
'conditions':
'conditions':
[
[
[ 'target_arch == "ia32"', {
[ 'target_arch == "ia32"', {
'xcode_settings': { 'ARCHS': [
'i386'
] }
'xcode_settings': { 'ARCHS': [
'i386'
] }
}],
}],
['target_arch == "x64"', {
[
'target_arch == "x64"', {
'xcode_settings': { 'ARCHS': [
'x86_64'
] }
'xcode_settings': { 'ARCHS': [
'x86_64'
] }
}],
}],
[ 'OS in "linux freebsd openbsd solaris"', {
[ 'OS in "linux freebsd openbsd solaris"', {
'target_conditions':
'target_conditions':
...
...
worker/include/Logger.h
浏览文件 @
c03210af
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
* verbose information, including current file and line.
* verbose information, including current file and line.
*
*
* MS_TRACE()
* MS_TRACE()
* MS_TRACE_STD()
*
*
* Logs the current method/function if the current source file defines the
* Logs the current method/function if the current source file defines the
* MS_LOG_TRACE macro.
* MS_LOG_TRACE macro.
...
@@ -41,7 +40,6 @@
...
@@ -41,7 +40,6 @@
* MS_DEBUG_DEV("Room closed [roomId:%" PRIu32 "]", roomId);
* MS_DEBUG_DEV("Room closed [roomId:%" PRIu32 "]", roomId);
*
*
* MS_ERROR(...)
* MS_ERROR(...)
* MS_ERROR_STD(...)
*
*
* Logs an error. Must just be used for internal errors that should not
* Logs an error. Must just be used for internal errors that should not
* happen.
* happen.
...
@@ -134,6 +132,17 @@ public:
...
@@ -134,6 +132,17 @@ public:
} \
} \
while (0)
while (0)
#define MS_DEBUG_TAG_STD(tag, desc, ...) \
do \
{ \
if (LogLevel::LOG_DEBUG == Settings::configuration.logLevel && (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
{ \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stdout); \
} \
} \
while (0)
#define MS_WARN_TAG(tag, desc, ...) \
#define MS_WARN_TAG(tag, desc, ...) \
do \
do \
{ \
{ \
...
@@ -145,6 +154,17 @@ public:
...
@@ -145,6 +154,17 @@ public:
} \
} \
while (0)
while (0)
#define MS_WARN_TAG_STD(tag, desc, ...) \
do \
{ \
if (LogLevel::LOG_WARN <= Settings::configuration.logLevel && (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
{ \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stderr); \
} \
} \
while (0)
#define MS_DEBUG_2TAGS(tag1, tag2, desc, ...) \
#define MS_DEBUG_2TAGS(tag1, tag2, desc, ...) \
do \
do \
{ \
{ \
...
@@ -156,6 +176,17 @@ public:
...
@@ -156,6 +176,17 @@ public:
} \
} \
while (0)
while (0)
#define MS_DEBUG_2TAGS_STD(tag, desc, ...) \
do \
{ \
if (LogLevel::LOG_DEBUG == Settings::configuration.logLevel && (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
{ \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stdout); \
} \
} \
while (0)
#define MS_WARN_2TAGS(tag1, tag2, desc, ...) \
#define MS_WARN_2TAGS(tag1, tag2, desc, ...) \
do \
do \
{ \
{ \
...
@@ -167,6 +198,17 @@ public:
...
@@ -167,6 +198,17 @@ public:
} \
} \
while (0)
while (0)
#define MS_WARN_2TAGS_STD(tag1, tag2, desc, ...) \
do \
{ \
if (LogLevel::LOG_WARN <= Settings::configuration.logLevel && (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
{ \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stderr); \
} \
} \
while (0)
#ifdef MS_LOG_DEV
#ifdef MS_LOG_DEV
#define MS_DEBUG_DEV(desc, ...) \
#define MS_DEBUG_DEV(desc, ...) \
do \
do \
...
@@ -179,6 +221,17 @@ public:
...
@@ -179,6 +221,17 @@ public:
} \
} \
while (0)
while (0)
#define MS_DEBUG_DEV_STD(desc, ...) \
do \
{ \
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); \
} \
} \
while (0)
#define MS_WARN_DEV(desc, ...) \
#define MS_WARN_DEV(desc, ...) \
do \
do \
{ \
{ \
...
@@ -189,9 +242,22 @@ public:
...
@@ -189,9 +242,22 @@ public:
} \
} \
} \
} \
while (0)
while (0)
#define MS_WARN_DEV_STD(desc, ...) \
do \
{ \
if (LogLevel::LOG_WARN <= Settings::configuration.logLevel) \
{ \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stderr); \
} \
} \
while (0)
#else
#else
#define MS_DEBUG_DEV(desc, ...)
#define MS_DEBUG_DEV(desc, ...)
#define MS_DEBUG_DEV_STD(desc, ...)
#define MS_WARN_DEV(desc, ...)
#define MS_WARN_DEV(desc, ...)
#define MS_WARN_DEV_STD(desc, ...)
#endif
#endif
#define MS_ERROR(desc, ...) \
#define MS_ERROR(desc, ...) \
...
@@ -228,10 +294,18 @@ public:
...
@@ -228,10 +294,18 @@ public:
#ifdef MS_LOG_STD
#ifdef MS_LOG_STD
#undef MS_TRACE
#undef MS_TRACE
#define MS_TRACE MS_TRACE_STD
#define MS_TRACE MS_TRACE_STD
#undef MS_DEBUG
#undef MS_DEBUG_TAG
#define MS_DEBUG MS_DEBUG_STD
#define MS_DEBUG_TAG MS_DEBUG_TAG_STD
#undef MS_WARN
#undef MS_WARN_TAG
#define MS_WARN MS_DEBUG_STD
#define MS_WARN_TAG MS_WARN_TAG_STD
#undef MS_DEBUG_2TAGS
#define MS_DEBUG_2TAGS MS_DEBUG_2TAGS_STD
#undef MS_WARN_2TAGS
#define MS_WARN_2TAGS MS_WARN_2TAGS_STD
#undef MS_DEBUG_DEV
#define MS_DEBUG_DEV MS_DEBUG_DEV_STD
#undef MS_WARN_DEV
#define MS_WARN_DEV MS_WARN_DEV_STD
#undef MS_ERROR
#undef MS_ERROR
#define MS_ERROR MS_ERROR_STD
#define MS_ERROR MS_ERROR_STD
#endif
#endif
...
...
worker/mediasoup-worker.gyp
浏览文件 @
c03210af
...
@@ -161,10 +161,10 @@
...
@@ -161,10 +161,10 @@
# Endianness
# Endianness
[ 'node_byteorder=="big"', {
[ 'node_byteorder=="big"', {
# Define Big Endian
# Define Big Endian
'defines': [
'MS_BIG_ENDIAN'
]
'defines': [
'MS_BIG_ENDIAN'
]
}, {
}, {
# Define Little Endian
# Define Little Endian
'defines': [
'MS_LITTLE_ENDIAN'
]
'defines': [
'MS_LITTLE_ENDIAN'
]
}],
}],
# Platform-specifics
# Platform-specifics
...
@@ -226,7 +226,7 @@
...
@@ -226,7 +226,7 @@
},
},
{
{
'target_name': 'mediasoup-worker-test',
'target_name': 'mediasoup-worker-test',
'defines': [
'MS_LOG_STD'
],
'defines': [
'MS_LOG_STD'
],
'sources':
'sources':
[
[
# C++ source files
# C++ source files
...
...
worker/src/Logger.cpp
浏览文件 @
c03210af
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
/* Class variables. */
/* Class variables. */
std
::
string
Logger
::
id
=
"un
defined
"
;
std
::
string
Logger
::
id
=
"un
set
"
;
Channel
::
UnixStreamSocket
*
Logger
::
channel
=
nullptr
;
Channel
::
UnixStreamSocket
*
Logger
::
channel
=
nullptr
;
char
Logger
::
buffer
[
MS_LOGGER_BUFFER_SIZE
];
char
Logger
::
buffer
[
MS_LOGGER_BUFFER_SIZE
];
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论