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

add configure options --log-verbose/info/trace to compile log macros. 0.9.169

This commit is contained in:
winlin 2014-07-23 14:37:54 +08:00
parent fd8c4989f5
commit f562a98602
5 changed files with 71 additions and 4 deletions

View file

@ -667,7 +667,25 @@ fi
echo "" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H
# for log level compile settings
if [ $SRS_LOG_VERBOSE = YES ]; then
echo "#define SRS_AUTO_VERBOSE" >> $SRS_AUTO_HEADERS_H
else
echo "#undef SRS_AUTO_VERBOSE" >> $SRS_AUTO_HEADERS_H
fi
if [ $SRS_LOG_INFO = YES ]; then
echo "#define SRS_AUTO_INFO" >> $SRS_AUTO_HEADERS_H
else
echo "#undef SRS_AUTO_INFO" >> $SRS_AUTO_HEADERS_H
fi
if [ $SRS_LOG_TRACE = YES ]; then
echo "#define SRS_AUTO_TRACE" >> $SRS_AUTO_HEADERS_H
else
echo "#undef SRS_AUTO_TRACE" >> $SRS_AUTO_HEADERS_H
fi
# prefix # prefix
echo "" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_AUTO_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H
echo "" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H

View file

@ -13,6 +13,8 @@
##################################################################################### #####################################################################################
help=no help=no
################################################################
# feature options
SRS_HLS=RESERVED SRS_HLS=RESERVED
SRS_DVR=RESERVED SRS_DVR=RESERVED
SRS_NGINX=RESERVED SRS_NGINX=RESERVED
@ -37,6 +39,7 @@ SRS_GPERF_CP=RESERVED
# gprof # gprof
SRS_GPROF=RESERVED SRS_GPROF=RESERVED
# #
################################################################
# libraries # libraries
SRS_FFMPEG_STUB=RESERVED SRS_FFMPEG_STUB=RESERVED
SRS_HTTP_PARSER=RESERVED SRS_HTTP_PARSER=RESERVED
@ -44,11 +47,18 @@ SRS_HTTP_PARSER=RESERVED
SRS_PREFIX=/usr/local/srs SRS_PREFIX=/usr/local/srs
SRS_JOBS=1 SRS_JOBS=1
SRS_STATIC=RESERVED SRS_STATIC=RESERVED
# whether enable the log verbose/info/trace level.
# always enable the warn/error level.
SRS_LOG_VERBOSE=RESERVED
SRS_LOG_INFO=RESERVED
SRS_LOG_TRACE=RESERVED
# #
################################################################
# experts # experts
# donot compile ssl, use system ssl(-lssl) if required. # donot compile ssl, use system ssl(-lssl) if required.
SRS_USE_SYS_SSL=NO SRS_USE_SYS_SSL=NO
# #
################################################################
# presets # presets
# for x86/x64 pc/servers # for x86/x64 pc/servers
SRS_X86_X64=NO SRS_X86_X64=NO
@ -77,6 +87,7 @@ SRS_DISABLE_ALL=NO
# all features is on # all features is on
SRS_ENABLE_ALL=NO SRS_ENABLE_ALL=NO
# #
################################################################
# calc # calc
# whether embed cpu, arm/mips # whether embed cpu, arm/mips
SRS_EMBEDED_CPU=NO SRS_EMBEDED_CPU=NO
@ -141,6 +152,9 @@ Options:
--static whether add '-static' to link options. --static whether add '-static' to link options.
--jobs[=N] Allow N jobs at once; infinite jobs with no arg. --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
used for make in the configure, for example, to make ffmpeg. used for make in the configure, for example, to make ffmpeg.
--log-verbose whether enable the log verbose level. default: no.
--log-info whether enable the log info level. default: no.
--log-trace whether enable the log trace level. default: yes.
Presets: Presets:
--x86-x64 [default] for x86/x64 cpu, common pc and servers. --x86-x64 [default] for x86/x64 cpu, common pc and servers.
@ -227,6 +241,9 @@ function parse_user_option() {
--jobs) SRS_JOBS=${value} ;; --jobs) SRS_JOBS=${value} ;;
--prefix) SRS_PREFIX=${value} ;; --prefix) SRS_PREFIX=${value} ;;
--static) SRS_STATIC=YES ;; --static) SRS_STATIC=YES ;;
--log-verbose) SRS_LOG_VERBOSE=YES ;;
--log-info) SRS_LOG_INFO=YES ;;
--log-trace) SRS_LOG_TRACE=YES ;;
--x86-x64) SRS_X86_X64=YES ;; --x86-x64) SRS_X86_X64=YES ;;
--arm) SRS_ARM_UBUNTU12=YES ;; --arm) SRS_ARM_UBUNTU12=YES ;;
@ -279,6 +296,11 @@ if [ $help = yes ]; then
fi fi
function apply_user_presets() { function apply_user_presets() {
# always set the log level for all presets.
SRS_LOG_VERBOSE=NO
SRS_LOG_INFO=NO
SRS_LOG_TRACE=YES
# set default preset if not specifies # set default preset if not specifies
if [ $SRS_RTMP_HLS = NO ]; then if [ $SRS_RTMP_HLS = NO ]; then
if [ $SRS_PURE_RTMP = NO ]; then if [ $SRS_PURE_RTMP = NO ]; then
@ -687,6 +709,9 @@ function regenerate_options() {
if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-arm-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-arm-ubuntu12"; fi if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-arm-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-arm-ubuntu12"; fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-mips-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-mips-ubuntu12"; fi if [ $SRS_MIPS_UBUNTU12 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-mips-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-mips-ubuntu12"; fi
if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi
if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi
if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi
if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi
echo "regenerate config: ${SRS_AUTO_CONFIGURE}" echo "regenerate config: ${SRS_AUTO_CONFIGURE}"
} }
regenerate_options regenerate_options

View file

@ -167,6 +167,30 @@ ok_msg "test \" ${item} \""
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
ok_msg "test \" ${item} \" success" ok_msg "test \" ${item} \" success"
item="./configure --fast --log-verbose"
ok_msg "test \" ${item} \""
(./configure --fast --log-verbose && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
ok_msg "test \" ${item} \" success"
item="./configure --fast --log-info"
ok_msg "test \" ${item} \""
(./configure --fast --log-info && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
ok_msg "test \" ${item} \" success"
item="./configure --fast --log-trace"
ok_msg "test \" ${item} \""
(./configure --fast --log-trace && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
ok_msg "test \" ${item} \" success"
item="./configure --fast --log-info --log-verbose --log-trace"
ok_msg "test \" ${item} \""
(./configure --fast --log-info --log-verbose --log-trace && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
ok_msg "test \" ${item} \" success"
####################################################################################################### #######################################################################################################
####################################################################################################### #######################################################################################################
####################################################################################################### #######################################################################################################

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version // current release version
#define VERSION_MAJOR "0" #define VERSION_MAJOR "0"
#define VERSION_MINOR "9" #define VERSION_MINOR "9"
#define VERSION_REVISION "168" #define VERSION_REVISION "169"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info. // server info.
#define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_KEY "SRS"

View file

@ -134,15 +134,15 @@ extern ISrsThreadContext* _srs_context;
#endif #endif
// TODO: FIXME: add more verbose and info logs. // TODO: FIXME: add more verbose and info logs.
#if 1 #ifndef SRS_AUTO_VERBOSE
#undef srs_verbose #undef srs_verbose
#define srs_verbose(msg, ...) (void)0 #define srs_verbose(msg, ...) (void)0
#endif #endif
#if 1 #ifndef SRS_AUTO_INFO
#undef srs_info #undef srs_info
#define srs_info(msg, ...) (void)0 #define srs_info(msg, ...) (void)0
#endif #endif
#if 0 #ifndef SRS_AUTO_TRACE
#undef srs_trace #undef srs_trace
#define srs_trace(msg, ...) (void)0 #define srs_trace(msg, ...) (void)0
#endif #endif