mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add log tank config, default to console.
This commit is contained in:
parent
b290a00de7
commit
7930add7f9
9 changed files with 100 additions and 62 deletions
|
@ -179,26 +179,6 @@ SrsServer::~SrsServer()
|
|||
int SrsServer::initialize()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// use linux epoll.
|
||||
if (st_set_eventsys(ST_EVENTSYS_ALT) == -1) {
|
||||
ret = ERROR_ST_SET_EPOLL;
|
||||
srs_error("st_set_eventsys use linux epoll failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_verbose("st_set_eventsys use linux epoll success");
|
||||
|
||||
if(st_init() != 0){
|
||||
ret = ERROR_ST_INITIALIZE;
|
||||
srs_error("st_init failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_verbose("st_init success");
|
||||
|
||||
// set current log id.
|
||||
_srs_context->generate_id();
|
||||
srs_info("log set id success");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -277,6 +257,32 @@ int SrsServer::acquire_pid_file()
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsServer::initialize_st()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// use linux epoll.
|
||||
if (st_set_eventsys(ST_EVENTSYS_ALT) == -1) {
|
||||
ret = ERROR_ST_SET_EPOLL;
|
||||
srs_error("st_set_eventsys use linux epoll failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_verbose("st_set_eventsys use linux epoll success");
|
||||
|
||||
if(st_init() != 0){
|
||||
ret = ERROR_ST_INITIALIZE;
|
||||
srs_error("st_init failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
srs_verbose("st_init success");
|
||||
|
||||
// set current log id.
|
||||
_srs_context->generate_id();
|
||||
srs_info("log set id success");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsServer::listen()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue