mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-05 00:47:51 -05:00
trace only non nil error
This commit is contained in:
parent
6bbc3a6945
commit
2b80d096ff
@ -68,6 +68,9 @@ func getLoggerAndPrefix(s errors.Severity) (internal.LogWriter, string) {
|
|||||||
|
|
||||||
// Trace logs an error message based on its severity.
|
// Trace logs an error message based on its severity.
|
||||||
func Trace(err error) {
|
func Trace(err error) {
|
||||||
|
if err == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
logger, prefix := getLoggerAndPrefix(errors.GetSeverity(err))
|
logger, prefix := getLoggerAndPrefix(errors.GetSeverity(err))
|
||||||
logger.Log(&internal.ErrorLog{
|
logger.Log(&internal.ErrorLog{
|
||||||
Prefix: prefix,
|
Prefix: prefix,
|
||||||
|
Loading…
Reference in New Issue
Block a user