always use system log and context. allow hijack the human print macro.
正在显示
2 个修改的文件
包含
10 行增加
和
9 行删除
| @@ -48,12 +48,9 @@ using namespace std; | @@ -48,12 +48,9 @@ using namespace std; | ||
| 48 | #include <srs_kernel_file.hpp> | 48 | #include <srs_kernel_file.hpp> |
| 49 | #include <srs_lib_bandwidth.hpp> | 49 | #include <srs_lib_bandwidth.hpp> |
| 50 | 50 | ||
| 51 | -// if want to use your log, define the folowing macro. | ||
| 52 | -#ifndef SRS_HIJACK_LOG | ||
| 53 | - // kernel module. | ||
| 54 | - ISrsLog* _srs_log = new ISrsLog(); | ||
| 55 | - ISrsThreadContext* _srs_context = new ISrsThreadContext(); | ||
| 56 | -#endif | 51 | +// kernel module. |
| 52 | +ISrsLog* _srs_log = new ISrsLog(); | ||
| 53 | +ISrsThreadContext* _srs_context = new ISrsThreadContext(); | ||
| 57 | 54 | ||
| 58 | /** | 55 | /** |
| 59 | * export runtime context. | 56 | * export runtime context. |
| @@ -926,9 +926,13 @@ extern int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* dat | @@ -926,9 +926,13 @@ extern int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* dat | ||
| 926 | 926 | ||
| 927 | // log to console, for use srs-librtmp application. | 927 | // log to console, for use srs-librtmp application. |
| 928 | extern const char* srs_human_format_time(); | 928 | extern const char* srs_human_format_time(); |
| 929 | -#define srs_human_trace(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n") | ||
| 930 | -#define srs_human_verbose(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n") | ||
| 931 | -#define srs_human_raw(msg, ...) printf(msg, ##__VA_ARGS__) | 929 | + |
| 930 | +// when hijack the log, user will defines this macros. | ||
| 931 | +#ifndef SRS_HIJACK_LOG | ||
| 932 | + #define srs_human_trace(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n") | ||
| 933 | + #define srs_human_verbose(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n") | ||
| 934 | + #define srs_human_raw(msg, ...) printf(msg, ##__VA_ARGS__) | ||
| 935 | +#endif | ||
| 932 | 936 | ||
| 933 | /************************************************************* | 937 | /************************************************************* |
| 934 | ************************************************************** | 938 | ************************************************************** |
-
请 注册 或 登录 后发表评论