mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add utility, change log to trace
This commit is contained in:
parent
94874e77af
commit
f2f30dcc52
6 changed files with 78 additions and 17 deletions
2
trunk/configure
vendored
2
trunk/configure
vendored
|
@ -436,7 +436,7 @@ MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_socke
|
||||||
"srs_app_http" "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log"
|
"srs_app_http" "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log"
|
||||||
"srs_app_config" "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api"
|
"srs_app_config" "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api"
|
||||||
"srs_app_http_conn" "srs_app_http_hooks" "srs_app_json" "srs_app_ingest"
|
"srs_app_http_conn" "srs_app_http_hooks" "srs_app_json" "srs_app_ingest"
|
||||||
"srs_app_ffmpeg")
|
"srs_app_ffmpeg" "srs_app_utility")
|
||||||
APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh
|
APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh
|
||||||
APP_OBJS="${MODULE_OBJS[@]}"
|
APP_OBJS="${MODULE_OBJS[@]}"
|
||||||
#
|
#
|
||||||
|
|
24
trunk/src/app/srs_app_utility.cpp
Normal file
24
trunk/src/app/srs_app_utility.cpp
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013-2014 winlin
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <srs_app_utility.hpp>
|
33
trunk/src/app/srs_app_utility.hpp
Normal file
33
trunk/src/app/srs_app_utility.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013-2014 winlin
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRS_APP_UTILITY_HPP
|
||||||
|
#define SRS_APP_UTILITY_HPP
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include <srs_app_utility.hpp>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <srs_core.hpp>
|
||||||
|
|
||||||
|
#endif
|
|
@ -131,11 +131,11 @@ extern ISrsThreadContext* _srs_context;
|
||||||
#define srs_error(msg, ...) _srs_log->error(__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
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 1
|
||||||
#undef srs_verbose
|
#undef srs_verbose
|
||||||
#define srs_verbose(msg, ...) (void)0
|
#define srs_verbose(msg, ...) (void)0
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 1
|
||||||
#undef srs_info
|
#undef srs_info
|
||||||
#define srs_info(msg, ...) (void)0
|
#define srs_info(msg, ...) (void)0
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21,18 +21,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <srs_kernel_log.hpp>
|
#include <srs_core.hpp>
|
||||||
#include <srs_kernel_error.hpp>
|
|
||||||
#include <srs_app_server.hpp>
|
|
||||||
#include <srs_app_config.hpp>
|
|
||||||
#include <srs_app_log.hpp>
|
|
||||||
|
|
||||||
// kernel module.
|
|
||||||
ISrsLog* _srs_log = new SrsFastLog();
|
|
||||||
ISrsThreadContext* _srs_context = new SrsThreadContext();
|
|
||||||
// app module.
|
|
||||||
SrsConfig* _srs_config = new SrsConfig();
|
|
||||||
SrsServer* _srs_server = new SrsServer();
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
@ -47,6 +36,19 @@ SrsServer* _srs_server = new SrsServer();
|
||||||
#include <gperftools/profiler.h>
|
#include <gperftools/profiler.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <srs_kernel_error.hpp>
|
||||||
|
#include <srs_app_server.hpp>
|
||||||
|
#include <srs_app_config.hpp>
|
||||||
|
#include <srs_app_log.hpp>
|
||||||
|
#include <srs_app_utility.hpp>
|
||||||
|
|
||||||
|
// kernel module.
|
||||||
|
ISrsLog* _srs_log = new SrsFastLog();
|
||||||
|
ISrsThreadContext* _srs_context = new SrsThreadContext();
|
||||||
|
// app module.
|
||||||
|
SrsConfig* _srs_config = new SrsConfig();
|
||||||
|
SrsServer* _srs_server = new SrsServer();
|
||||||
|
|
||||||
void handler(int signo)
|
void handler(int signo)
|
||||||
{
|
{
|
||||||
srs_trace("get a signal, signo=%d", signo);
|
srs_trace("get a signal, signo=%d", signo);
|
||||||
|
|
|
@ -77,8 +77,6 @@ file
|
||||||
..\app\srs_app_rtmp_conn.cpp,
|
..\app\srs_app_rtmp_conn.cpp,
|
||||||
..\app\srs_app_pithy_print.hpp,
|
..\app\srs_app_pithy_print.hpp,
|
||||||
..\app\srs_app_pithy_print.cpp,
|
..\app\srs_app_pithy_print.cpp,
|
||||||
..\app\srs_app_thread.hpp,
|
|
||||||
..\app\srs_app_thread.cpp,
|
|
||||||
..\app\srs_app_server.hpp,
|
..\app\srs_app_server.hpp,
|
||||||
..\app\srs_app_server.cpp,
|
..\app\srs_app_server.cpp,
|
||||||
..\app\srs_app_st.hpp,
|
..\app\srs_app_st.hpp,
|
||||||
|
@ -87,6 +85,10 @@ file
|
||||||
..\app\srs_app_socket.cpp,
|
..\app\srs_app_socket.cpp,
|
||||||
..\app\srs_app_source.hpp,
|
..\app\srs_app_source.hpp,
|
||||||
..\app\srs_app_source.cpp,
|
..\app\srs_app_source.cpp,
|
||||||
|
..\app\srs_app_thread.hpp,
|
||||||
|
..\app\srs_app_thread.cpp,
|
||||||
|
..\app\srs_app_utility.hpp,
|
||||||
|
..\app\srs_app_utility.cpp,
|
||||||
utest readonly separator,
|
utest readonly separator,
|
||||||
..\utest\srs_utest.hpp,
|
..\utest\srs_utest.hpp,
|
||||||
..\utest\srs_utest.cpp,
|
..\utest\srs_utest.cpp,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue