chore/Clean up logger messaging

Use the correct variable names for the .Str() and capslock the the MAC
This commit is contained in:
Marc Brooks 2025-11-06 21:27:02 -06:00
parent 36f06a064a
commit fb5e4fd772
No known key found for this signature in database
GPG Key ID: 583A6AF2D6AE1DC6
1 changed files with 2 additions and 2 deletions

4
web.go
View File

@ -814,7 +814,7 @@ func handleSendWOLMagicPacket(c *gin.Context) {
inputMacAddr := c.Param("mac-addr") inputMacAddr := c.Param("mac-addr")
macAddr, err := net.ParseMAC(inputMacAddr) macAddr, err := net.ParseMAC(inputMacAddr)
if err != nil { if err != nil {
logger.Warn().Err(err).Str("sendWol", inputMacAddr).Msg("Invalid mac address provided") logger.Warn().Err(err).Str("inputMacAddr", inputMacAddr).Msg("Invalid MAC address provided")
c.String(http.StatusBadRequest, "Invalid mac address provided") c.String(http.StatusBadRequest, "Invalid mac address provided")
return return
} }
@ -822,7 +822,7 @@ func handleSendWOLMagicPacket(c *gin.Context) {
macAddrString := macAddr.String() macAddrString := macAddr.String()
err = rpcSendWOLMagicPacket(macAddrString) err = rpcSendWOLMagicPacket(macAddrString)
if err != nil { if err != nil {
logger.Warn().Err(err).Str("sendWOL", macAddrString).Msg("Failed to send WOL magic packet") logger.Warn().Err(err).Str("macAddrString", macAddrString).Msg("Failed to send WOL magic packet")
c.String(http.StatusInternalServerError, "Failed to send WOL to %s: %v", macAddrString, err) c.String(http.StatusInternalServerError, "Failed to send WOL to %s: %v", macAddrString, err)
return return
} }