update log

This commit is contained in:
haibo.chen
2025-05-09 17:00:32 +08:00
committed by Haibo Chen(陈海博)
parent b55a9d9a82
commit 5b4dbca9da
11 changed files with 278 additions and 55 deletions

View File

@ -1,12 +1,11 @@
package service
import (
"context"
"fmt"
"log/slog"
"sync"
"time"
"github.com/ossrs/go-oryx-lib/logger"
"github.com/ossrs/srs-sip/pkg/models"
)
@ -98,7 +97,10 @@ func (dm *deviceManager) checkHeartbeats() {
device.SourceAddr = ""
device.Online = false
dm.devices.Store(key, device)
logger.Wf(context.Background(), "Device %s is offline due to heartbeat timeout, HeartBeatInterval: %v", device.DeviceID, device.HeartBeatInterval)
slog.Warn("Device is offline due to heartbeat timeout",
"device_id", device.DeviceID,
"heartbeat_interval", device.HeartBeatInterval,
"heartbeat_count", device.HeartBeatCount)
}
}
return true