Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "Hello, World!" examples in automation documentation (openhab#14041)
Browse files Browse the repository at this point in the history
The documentation states incorrectly that "Hello, World!" is printed when instead "Hello world!" is printed.

Signed-off-by: Wouter Born <[email protected]>
Signed-off-by: Doug Culnane <[email protected]>
wborn authored and dougculnane committed Dec 26, 2022
1 parent 5d4a8d6 commit 08a7e17
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bundles/org.openhab.automation.groovyscripting/README.md
Original file line number Diff line number Diff line change
@@ -31,13 +31,13 @@ The openHAB server uses the [SLF4J](https://www.slf4j.org/) library for logging.
```groovy
import org.slf4j.LoggerFactory
LoggerFactory.getLogger("org.openhab.core.automation.examples").info("Hello world!")
LoggerFactory.getLogger("org.openhab.core.automation.examples").info("Hello, World!")
```

Depending on the openHAB logging configuration, you may need to prefix logger names with `org.openhab.core.automation` for them to show up in the log file (or you modify the logging configuration).

The script uses the [LoggerFactory](https://www.slf4j.org/apidocs/org/slf4j/Logger.html) to obtain a named logger and then logs a message like:

```text
... [INFO ] [.openhab.core.automation.examples:-2 ] - Hello world!
... [INFO ] [.openhab.core.automation.examples:-2 ] - Hello, World!
```
2 changes: 1 addition & 1 deletion bundles/org.openhab.automation.jrubyscripting/README.md
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ The openHAB server uses the [SLF4J](https://www.slf4j.org/) library for logging.
require 'java'
java_import org.slf4j.LoggerFactory

LoggerFactory.getLogger("org.openhab.automation.examples").info("Hello world!")
LoggerFactory.getLogger("org.openhab.automation.examples").info("Hello, World!")
```

JRuby can [import Java classes](https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby).
4 changes: 2 additions & 2 deletions bundles/org.openhab.automation.jythonscripting/README.md
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ The openHAB server uses the [SLF4J](https://www.slf4j.org/) library for logging.
```python
from org.slf4j import LoggerFactory

LoggerFactory.getLogger("org.openhab.core.automation.examples").info("Hello world!")
LoggerFactory.getLogger("org.openhab.core.automation.examples").info("Hello, World!")
```

Jython can [import Java classes](https://jython.readthedocs.io/en/latest/ModulesPackages/).
@@ -52,5 +52,5 @@ The script uses the [LoggerFactory](https://www.slf4j.org/apidocs/org/slf4j/Logg
to obtain a named logger and then logs a message like:

```text
... [INFO ] [.openhab.core.automation.examples:-2 ] - Hello world!
... [INFO ] [.openhab.core.automation.examples:-2 ] - Hello, World!
```

0 comments on commit 08a7e17

Please sign in to comment.