1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

always use system log and context. allow hijack the human print macro.

This commit is contained in:
winlin 2014-12-02 12:51:07 +08:00
parent 3584bdb7b6
commit f6032ffe6b
2 changed files with 10 additions and 9 deletions

View file

@ -48,12 +48,9 @@ using namespace std;
#include <srs_kernel_file.hpp>
#include <srs_lib_bandwidth.hpp>
// if want to use your log, define the folowing macro.
#ifndef SRS_HIJACK_LOG
// kernel module.
ISrsLog* _srs_log = new ISrsLog();
ISrsThreadContext* _srs_context = new ISrsThreadContext();
#endif
// kernel module.
ISrsLog* _srs_log = new ISrsLog();
ISrsThreadContext* _srs_context = new ISrsThreadContext();
/**
* export runtime context.

View file

@ -926,9 +926,13 @@ extern int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* dat
// log to console, for use srs-librtmp application.
extern const char* srs_human_format_time();
#define srs_human_trace(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n")
#define srs_human_verbose(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n")
#define srs_human_raw(msg, ...) printf(msg, ##__VA_ARGS__)
// when hijack the log, user will defines this macros.
#ifndef SRS_HIJACK_LOG
#define srs_human_trace(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n")
#define srs_human_verbose(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n")
#define srs_human_raw(msg, ...) printf(msg, ##__VA_ARGS__)
#endif
/*************************************************************
**************************************************************