winlin

add thread cid to log

@@ -132,6 +132,7 @@ int SrsForwarder::on_publish(SrsRequest* req, std::string forward_server) @@ -132,6 +132,7 @@ int SrsForwarder::on_publish(SrsRequest* req, std::string forward_server)
132 srs_error("start srs thread failed. ret=%d", ret); 132 srs_error("start srs thread failed. ret=%d", ret);
133 return ret; 133 return ret;
134 } 134 }
  135 + srs_trace("forward thread cid=%d, current_cid=%d", pthread->cid(), _srs_context->get_id());
135 136
136 return ret; 137 return ret;
137 } 138 }
@@ -83,6 +83,7 @@ int SrsIngester::start() @@ -83,6 +83,7 @@ int SrsIngester::start()
83 srs_error("st_thread_create failed. ret=%d", ret); 83 srs_error("st_thread_create failed. ret=%d", ret);
84 return ret; 84 return ret;
85 } 85 }
  86 + srs_trace("ingest thread cid=%d, current_cid=%d", pthread->cid(), _srs_context->get_id());
86 87
87 return ret; 88 return ret;
88 } 89 }
@@ -129,7 +129,9 @@ int SrsListener::listen(int port) @@ -129,7 +129,9 @@ int SrsListener::listen(int port)
129 } 129 }
130 srs_verbose("create st listen thread success."); 130 srs_verbose("create st listen thread success.");
131 131
132 - srs_trace("server started, listen at port=%d, type=%d, fd=%d", _port, _type, fd); 132 + srs_trace("listen thread cid=%d, current_cid=%d, "
  133 + "listen at port=%d, type=%d, fd=%d started success",
  134 + pthread->cid(), _srs_context->get_id(), _port, _type, fd);
133 135
134 return ret; 136 return ret;
135 } 137 }
@@ -349,7 +351,7 @@ int SrsServer::initialize_st() @@ -349,7 +351,7 @@ int SrsServer::initialize_st()
349 351
350 // set current log id. 352 // set current log id.
351 _srs_context->generate_id(); 353 _srs_context->generate_id();
352 - srs_info("log set id success"); 354 + srs_trace("server main cid=%d", _srs_context->get_id());
353 355
354 return ret; 356 return ret;
355 } 357 }