[skeleton] Make example logging compliant to Coding Guidelines (#1646)

See https://www.openhab.org/docs/developer/guidelines.html#f-logging point 4
Also give an example for the logging severities, as many binding PRs log to info or error.

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
pull/1647/head
Fabian Wolter 2020-09-15 15:33:30 +02:00 committed by GitHub
parent 57d4487f36
commit 39d6986df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -63,7 +63,6 @@ public class ${bindingIdCamelCase}Handler extends BaseThingHandler {
@Override
public void initialize() {
// logger.debug("Start initializing!");
config = getConfigAs(${bindingIdCamelCase}Configuration.class);
// TODO: Initialize the handler.
@ -90,7 +89,10 @@ public class ${bindingIdCamelCase}Handler extends BaseThingHandler {
}
});
// logger.debug("Finished initializing!");
// These logging types should be primarily used by bindings
// logger.trace("Example trace message");
// logger.debug("Example debug message");
// logger.warn("Example warn message");
// Note: When initialization can NOT be done set the status with more details for further
// analysis. See also class ThingStatusDetail for all available status details.