fixed wrong log message format specifiers

This commit is contained in:
2025-12-19 13:25:57 +09:00
parent 80ebd23858
commit d705479ec8
2 changed files with 16 additions and 11 deletions

View File

@@ -1056,12 +1056,12 @@ func (cts *ServerConn) receive_from_stream(wg *sync.WaitGroup) {
if err != nil {
r.ReqStop()
cts.S.log.Write(cts.Sid, LOG_ERROR,
"Failed to send %s event(%d,%s,%s,%s%v,%v) to client %s - %s",
"Failed to send %s event(%d,%s,%s,%v,%v) to client %s - %s",
PACKET_KIND_ROUTE_STARTED.String(), r.Id, r.PtcAddr, r.SvcAddr.String(), r.SvcOption, r.SvcPermNet, cts.RemoteAddr, err.Error())
goto done
} else {
cts.S.log.Write(cts.Sid, LOG_DEBUG,
"Sent %s event(%d,%s,%s,%s%v,%v) to client %s",
"Sent %s event(%d,%s,%s,%v,%v) to client %s",
PACKET_KIND_ROUTE_STARTED.String(), r.Id, r.PtcAddr, r.SvcAddr.String(), r.SvcOption, r.SvcPermNet, cts.RemoteAddr)
}
}
@@ -1090,12 +1090,12 @@ func (cts *ServerConn) receive_from_stream(wg *sync.WaitGroup) {
if err != nil {
r.ReqStop()
cts.S.log.Write(cts.Sid, LOG_ERROR,
"Failed to send %s event(%d,%s,%s,%v.%v) to client %s - %s",
"Failed to send %s event(%d,%s,%s,%v,%v) to client %s - %s",
PACKET_KIND_ROUTE_STOPPED.String(), r.Id, r.PtcAddr, r.SvcAddr.String(), r.SvcOption, r.SvcPermNet.String(), cts.RemoteAddr, err.Error())
goto done
} else {
cts.S.log.Write(cts.Sid, LOG_DEBUG,
"Sent %s event(%d,%s,%s,%v.%v) to client %s",
"Sent %s event(%d,%s,%s,%v,%v) to client %s",
PACKET_KIND_ROUTE_STOPPED.String(), r.Id, r.PtcAddr, r.SvcAddr.String(), r.SvcOption, r.SvcPermNet.String(), cts.RemoteAddr)
}
}

View File

@@ -162,7 +162,14 @@ window.onload = function(event) {
let set_terminal_status = function(msg, errmsg) {
if (msg != null) terminal_status.innerText = msg;
if (errmsg != null) terminal_errmsg.innerText = errmsg;
if (errmsg != null) {
if (errmsg != "") {
const d = new Date();
terminal_errmsg.innerText = "[" + d.toLocaleString() + "] " + errmsg;
} else {
terminal_errmsg.innerText = errmsg;
}
}
}
let adjust_terminal_size_unconnected = function() {
@@ -270,14 +277,12 @@ window.onload = function(event) {
}
}
} else if (msg.type == 'error') {
toggle_login_form(true);
window.onresize = adjust_terminal_size_unconnected;
// retain the session but show the exception message
set_terminal_status(null, msg.data.join(' '))
}
} catch (e) {
set_terminal_status('Disconnected', e);
toggle_login_form(true)
window.onresize = adjust_terminal_size_unconnected;
// retain the session but show the exception message
set_terminal_status(null, e);
}
};