Logging in Driver

Seeing if you guys can help here. I have a driver where I'm logging the settings during the update method. Here's the log entry:

I don't have either of these as preferences in the driver. Are these baked in? Should we normalize on using those variable names?
logEnable:false,
logDebug:false

preferences {
    input name: "deviceIP", type: "text", title: getFormat("header","IoTaWatt Hub IP/Hostname"), description: getFormat("important","IP or DNS name"), required: true, displayDuringSetup: true
    input name: "pollingInterval", type: "number", title: getFormat("header","Polling Interval"), description: getFormat("important","In seconds (10-300)"), range: "10..300", defaultValue: 30, displayDuringSetup: true
    input name: "debugOutput", type: "bool", title: getFormat("header","Enable debug logging"), defaultValue: true
}

The "settings" variable is persistent so if you had that device on any other driver the settings could be from that. Could possibly do settings = [:] to wipe it.

2 Likes

That was it. Cool. Appreciate it!

To directly answer this, there is no inherent reason to, and I resisted doing it for a long time since I didn't find the conventional names (logEnable and enableDesc for debug and info/descriptionText logging) meaningful to me ... but I saw someone complain once that Preference Manager separates them out, then, so I suppose that's one reason you might want to. :slight_smile:

I wasn't sure if settings let you directly manipulate the entire map as suggested above, but apparently that works; otherwise, clearSetting(key) is an option for any particular key.

Appreciate the input as always. I just deleted and re-created the device. Seemed like the simpler route :slight_smile:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.