# \`log\` package now support string formatting method

**URL:** <https://www.rubin.community/t/log-package-now-support-string-formatting-method/1571>\
**Category:** Data Management\
**Tags:** dm-dev\
**Created:** [January 20, 2017, 8:49pm UTC](https://www.rubin.community/t/log-package-now-support-string-formatting-method/1571 "2017-01-20T20:49:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![timj](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/timj/32/10_2.png) [@timj](https://www.rubin.community/u/timj)\
**Post date:** [January 20, 2017, 8:49pm UTC](https://www.rubin.community/t/log-package-now-support-string-formatting-method/1571/1 "2017-01-20T20:49:21Z")

</div>

Following [RFC-265](https://jira.lsstcorp.org/browse/RFC-265) it is now possible to use Python string `format()` method syntax in log messages. For each of the standard logging methods, `log`, `warn`, `info`, `debug` etc, there are now `f` variants that support string formatting: `logf`, `warnf`, `infof`, `debugf` etc.

For example

```python
log.warnf(“Value: {}”, value)
log.infof(“Swap: {1} <-> {0} {places}”, 2, 1, places=“Tucson”)

```

All the normal `str.format()` syntax should work.
