mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
add macro to disable log.
This commit is contained in:
parent
07d55010fe
commit
15ae4745f4
1 changed files with 10 additions and 2 deletions
|
@ -926,8 +926,12 @@ extern int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* dat
|
||||||
// log to console, for use srs-librtmp application.
|
// log to console, for use srs-librtmp application.
|
||||||
extern const char* srs_human_format_time();
|
extern const char* srs_human_format_time();
|
||||||
|
|
||||||
// when hijack the log, user will defines this macros.
|
// when disabled log, donot compile it.
|
||||||
#ifndef SRS_HIJACK_LOG
|
#ifdef SRS_DISABLE_LOG
|
||||||
|
#define srs_human_trace(msg, ...) (void)0
|
||||||
|
#define srs_human_verbose(msg, ...) (void)0
|
||||||
|
#define srs_human_raw(msg, ...) (void)0
|
||||||
|
#else
|
||||||
#define srs_human_trace(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n")
|
#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_verbose(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n")
|
||||||
#define srs_human_raw(msg, ...) printf(msg, ##__VA_ARGS__)
|
#define srs_human_raw(msg, ...) printf(msg, ##__VA_ARGS__)
|
||||||
|
@ -944,6 +948,10 @@ typedef void* srs_hijack_io_t;
|
||||||
// the example @see https://github.com/winlinvip/st-load
|
// the example @see https://github.com/winlinvip/st-load
|
||||||
// which use librtmp but use its own io(use st also).
|
// which use librtmp but use its own io(use st also).
|
||||||
#ifdef SRS_HIJACK_IO
|
#ifdef SRS_HIJACK_IO
|
||||||
|
#ifndef _WIN32
|
||||||
|
// for iovec.
|
||||||
|
#include <sys/uio.h>
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* create hijack.
|
* create hijack.
|
||||||
* @return NULL for error; otherwise, ok.
|
* @return NULL for error; otherwise, ok.
|
||||||
|
|
Loading…
Reference in a new issue