mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Log: Support tag for log
This commit is contained in:
parent
57288838d0
commit
4c459a004e
4 changed files with 17 additions and 27 deletions
|
@ -108,27 +108,17 @@ extern ISrsContext* _srs_context;
|
|||
// Log style.
|
||||
// Use __FUNCTION__ to print c method
|
||||
// Use __PRETTY_FUNCTION__ to print c++ class:method
|
||||
#if 1
|
||||
#define srs_verbose(msg, ...) _srs_log->verbose(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_info(msg, ...) _srs_log->info(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_trace(msg, ...) _srs_log->trace(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_warn(msg, ...) _srs_log->warn(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_error(msg, ...) _srs_log->error(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#endif
|
||||
#if 0
|
||||
#define srs_verbose(msg, ...) _srs_log->verbose(__FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_info(msg, ...) _srs_log->info(__FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_trace(msg, ...) _srs_log->trace(__FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_warn(msg, ...) _srs_log->warn(__FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_error(msg, ...) _srs_log->error(__FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#endif
|
||||
#if 0
|
||||
#define srs_verbose(msg, ...) _srs_log->verbose(__PRETTY_FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_info(msg, ...) _srs_log->info(__PRETTY_FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_trace(msg, ...) _srs_log->trace(__PRETTY_FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_warn(msg, ...) _srs_log->warn(__PRETTY_FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_error(msg, ...) _srs_log->error(__PRETTY_FUNCTION__, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#endif
|
||||
#define srs_verbose(msg, ...) _srs_log->verbose(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_info(msg, ...) _srs_log->info(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_trace(msg, ...) _srs_log->trace(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_warn(msg, ...) _srs_log->warn(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_error(msg, ...) _srs_log->error(NULL, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
// With tag.
|
||||
#define srs_verbose2(tag, msg, ...) _srs_log->verbose(tag, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_info2(tag, msg, ...) _srs_log->info(tag, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_trace2(tag, msg, ...) _srs_log->trace(tag, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_warn2(tag, msg, ...) _srs_log->warn(tag, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
#define srs_error2(tag, msg, ...) _srs_log->error(tag, _srs_context->get_id(), msg, ##__VA_ARGS__)
|
||||
|
||||
// TODO: FIXME: Add more verbose and info logs.
|
||||
#ifndef SRS_VERBOSE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue