mirror of
https://github.com/aler9/rtsp-simple-server
synced 2026-04-22 23:17:11 +08:00
improve listener labels (#5635)
add a label after every "listener opened on :XXX" message that mentions protocols of every listener.
This commit is contained in:
@@ -55,10 +55,10 @@ logStructured: true
|
||||
Obtaining:
|
||||
|
||||
```
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05.999999999+01:00","level":"INF","message":"[RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05.999999999+01:00","level":"INF","message":"[RTSP] listener opened on :8554 (TCP/RTSP), :8000 (UDP/RTP), :8001 (UDP/RTCP)"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05.999999999+01:00","level":"INF","message":"[RTMP] listener opened on :1935"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05.999999999+01:00","level":"INF","message":"[HLS] listener opened on :8888"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05.999999999+01:00","level":"INF","message":"[WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05.999999999+01:00","level":"INF","message":"[WebRTC] listener opened on :8889 (TCP/HTTP), :8189 (UDP/ICE)"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05.999999999+01:00","level":"INF","message":"[SRT] listener opened on :8890 (UDP)"}
|
||||
```
|
||||
|
||||
|
||||
+7
-1
@@ -179,7 +179,13 @@ func (a *API) Initialize() error {
|
||||
return err
|
||||
}
|
||||
|
||||
a.Log(logger.Info, "listener opened on "+a.Address)
|
||||
str := "listener opened on " + a.Address
|
||||
if !a.Encryption {
|
||||
str += " (TCP/HTTP)"
|
||||
} else {
|
||||
str += " (TCP/HTTPS)"
|
||||
}
|
||||
a.Log(logger.Info, str)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -122,7 +122,13 @@ func (m *Metrics) Initialize() error {
|
||||
return err
|
||||
}
|
||||
|
||||
m.Log(logger.Info, "listener opened on "+m.Address)
|
||||
str := "listener opened on " + m.Address
|
||||
if !m.Encryption {
|
||||
str += " (TCP/HTTP)"
|
||||
} else {
|
||||
str += " (TCP/HTTPS)"
|
||||
}
|
||||
m.Log(logger.Info, str)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -66,7 +66,13 @@ func (s *Server) Initialize() error {
|
||||
return err
|
||||
}
|
||||
|
||||
s.Log(logger.Info, "listener opened on "+s.Address)
|
||||
str := "listener opened on " + s.Address
|
||||
if !s.Encryption {
|
||||
str += " (TCP/HTTP)"
|
||||
} else {
|
||||
str += " (TCP/HTTPS)"
|
||||
}
|
||||
s.Log(logger.Info, str)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -69,7 +69,13 @@ func (pp *PPROF) Initialize() error {
|
||||
return err
|
||||
}
|
||||
|
||||
pp.Log(logger.Info, "listener opened on "+pp.Address)
|
||||
str := "listener opened on " + pp.Address
|
||||
if !pp.Encryption {
|
||||
str += " (TCP/HTTP)"
|
||||
} else {
|
||||
str += " (TCP/HTTPS)"
|
||||
}
|
||||
pp.Log(logger.Info, str)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -138,7 +138,13 @@ func (s *Server) Initialize() error {
|
||||
return err
|
||||
}
|
||||
|
||||
s.Log(logger.Info, "listener opened on "+s.Address)
|
||||
str := "listener opened on " + s.Address
|
||||
if !s.Encryption {
|
||||
str += " (TCP/HTTP)"
|
||||
} else {
|
||||
str += " (TCP/HTTPS)"
|
||||
}
|
||||
s.Log(logger.Info, str)
|
||||
|
||||
s.wg.Add(1)
|
||||
go s.run()
|
||||
|
||||
@@ -145,7 +145,13 @@ func (s *Server) Initialize() error {
|
||||
s.chAPIConnsGet = make(chan serverAPIConnsGetReq)
|
||||
s.chAPIConnsKick = make(chan serverAPIConnsKickReq)
|
||||
|
||||
s.Log(logger.Info, "listener opened on %s", s.Address)
|
||||
str := "listener opened on " + s.Address
|
||||
if s.IsTLS {
|
||||
str += " (TCP/RTMPS)"
|
||||
} else {
|
||||
str += " (TCP/RTMP)"
|
||||
}
|
||||
s.Log(logger.Info, str)
|
||||
|
||||
l := &listener{
|
||||
ln: s.ln,
|
||||
|
||||
@@ -306,12 +306,17 @@ func (s *Server) Initialize() error {
|
||||
}
|
||||
}
|
||||
|
||||
str := "listener opened on " + s.Address + " (HTTP)"
|
||||
str := "listener opened on " + s.Address
|
||||
if !s.Encryption {
|
||||
str += " (TCP/HTTP)"
|
||||
} else {
|
||||
str += " (TCP/HTTPS)"
|
||||
}
|
||||
if s.udpMuxLn != nil {
|
||||
str += ", " + s.LocalUDPAddress + " (ICE/UDP)"
|
||||
str += ", " + s.LocalUDPAddress + " (UDP/ICE)"
|
||||
}
|
||||
if s.tcpMuxLn != nil {
|
||||
str += ", " + s.LocalTCPAddress + " (ICE/TCP)"
|
||||
str += ", " + s.LocalTCPAddress + " (TCP/ICE)"
|
||||
}
|
||||
s.Log(logger.Info, str)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user