feat(csms): 增强 OCPP 操作的日志记录,添加请求和响应的详细信息
This commit is contained in:
@@ -12,6 +12,10 @@ export async function handleBootNotification(
|
||||
payload: BootNotificationRequest,
|
||||
ctx: OcppConnectionContext,
|
||||
): Promise<BootNotificationResponse> {
|
||||
console.info(
|
||||
`[OCPP][ACTION][BootNotification][BEGIN] cp=${ctx.chargePointIdentifier} vendor=${payload.chargePointVendor} model=${payload.chargePointModel} fw=${payload.firmwareVersion ?? 'n/a'}`,
|
||||
)
|
||||
|
||||
const db = useDrizzle()
|
||||
const { heartbeatInterval } = await getOcpp16jSettings()
|
||||
|
||||
@@ -57,7 +61,9 @@ export async function handleBootNotification(
|
||||
const status = cp.registrationStatus
|
||||
ctx.isRegistered = status === 'Accepted'
|
||||
|
||||
console.log(`[OCPP] BootNotification ${ctx.chargePointIdentifier} status=${status}`)
|
||||
console.info(
|
||||
`[OCPP][ACTION][BootNotification][END] cp=${ctx.chargePointIdentifier} status=${status} heartbeatInterval=${heartbeatInterval}`,
|
||||
)
|
||||
|
||||
return {
|
||||
currentTime: dayjs().toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user