# \[SOLVED\] Migrating binding to new development environment: org.slf4j errors

**URL:** <https://community.openhab.org/t/solved-migrating-binding-to-new-development-environment-org-slf4j-errors/82141>\
**Category:** IDE & Build\
**Created:** [September 18, 2019, 4:51pm UTC](https://community.openhab.org/t/solved-migrating-binding-to-new-development-environment-org-slf4j-errors/82141 "2019-09-18T16:51:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kjoglums](https://community.openhab.org/user_avatar/community.openhab.org/kjoglums/32/57617_2.png) [@kjoglums](https://community.openhab.org/u/kjoglums)\
**Post date:** [September 18, 2019, 4:51pm UTC](https://community.openhab.org/t/solved-migrating-binding-to-new-development-environment-org-slf4j-errors/82141/1 "2019-09-18T16:51:32Z")

</div>

So, I am a rookie in the process of migrating a binding into the new development environment, successfully following @hilbrand tutorial (using Eclipse IDE):

[https://community.openhab.org/t/tutorial-migrate-your-binding-to-the-maven-bnd-based-build-system/81389](https://community.openhab.org/t/tutorial-migrate-your-binding-to-the-maven-bnd-based-build-system/81389)

However, as I run the `mvn clean install`, I get several errors pointing to a common issue throughout the code (not having issues in previous development environment):

```csv
[ERROR] org.openhab.binding.<MyBinding>.<MyJava.java>:[105]
Format should be constant. Use placeholder to reduce the needless cost of parameter construction. see http://www.slf4j.org/faq.html#logging_performance

```

All problems relate to `logger.debug`, showing an example code below:

```csv
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
//
//
private final Logger logger = LoggerFactory.getLogger(My.class);
//
//
logger.debug(device.toString());

```

The error then points to the `logger.debug(device.toString());`

Any guidance/tips would be appreciated. I also see similar use of `logger.debug` from other bindings.

---

<div class="post-metadata">

**Author:** ![massi](https://community.openhab.org/user_avatar/community.openhab.org/massi/32/34304_2.png) [@massi](https://community.openhab.org/u/massi)\
**Post date:** [September 18, 2019, 5:14pm UTC](https://community.openhab.org/t/solved-migrating-binding-to-new-development-environment-org-slf4j-errors/82141/2 "2019-09-18T17:14:15Z")

</div>

Usa placeholders in all loglines, as suggested.  
For example:

```auto
logger.debug("Device {}", device.toString());

```

---

<div class="post-metadata">

**Author:** ![hilbrand](https://community.openhab.org/user_avatar/community.openhab.org/hilbrand/32/72354_2.png) [@hilbrand](https://community.openhab.org/u/hilbrand)\
**Post date:** [September 18, 2019, 7:11pm UTC](https://community.openhab.org/t/solved-migrating-binding-to-new-development-environment-org-slf4j-errors/82141/3 "2019-09-18T19:11:23Z")

</div>

As an additional comment. Leave out the `toString`. The logger will call `toString` itself. And by not using `toString()` the `toString` method is only called when debug level is enabled. When using the `device.toString()` the `toString` is always performed even when debug level is not enabled.

```auto
logger.debug("Device {}", device);

```

---

<div class="post-metadata">

**Author:** ![kjoglums](https://community.openhab.org/user_avatar/community.openhab.org/kjoglums/32/57617_2.png) [@kjoglums](https://community.openhab.org/u/kjoglums)\
**Post date:** [September 18, 2019, 8:04pm UTC](https://community.openhab.org/t/solved-migrating-binding-to-new-development-environment-org-slf4j-errors/82141/4 "2019-09-18T20:04:03Z")

</div>

Quite an easy fix…

Appreciate your guidance!
