We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[APP SUBMITTED]: KeyError: "u'version'"

### INFO
**Python Version**: `2.7.13 (default, Dec 18 2016, 21:23:50) [GCC 4.6.4]`
**Operating System**: `Linux-3.2.40-armv7l-with-glibc2.4`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@7b9111eef5836a6846499ef257ffff3f1f35df8f
**Link to Log**: https://gist.github.com/adaeb1415fefd1083f59da7f01134ac6
### ERROR
<pre>
2017-12-29 19:52:25 ERROR    FINDPROPERS :: [7b9111e] BraceMessage string formatting failed. Using representation instead.
  File "/usr/local/python/lib/python2.7/threading.py", line 774, in __bootstrap
    self.__bootstrap_inner()
  File "/usr/local/python/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/scheduler.py#L90">SickBeard/medusa/scheduler.py</a>", line 90, in run
    self.action.run(self.force)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/search/proper.py#L65">SickBeard/medusa/search/proper.py</a>", line 65, in run
    self._download_propers(propers)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/search/proper.py#L353">SickBeard/medusa/search/proper.py</a>", line 353, in _download_propers
    snatch_episode(cur_proper)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/search/core.py#L159">SickBeard/medusa/search/core.py</a>", line 159, in snatch_episode
    result_downloaded = client.send_torrent(result)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/clients/torrent/generic.py#L254">SickBeard/medusa/clients/torrent/generic.py</a>", line 254, in send_torrent
    r_code = self._add_torrent_uri(result)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/clients/torrent/download_station_client.py#L124">SickBeard/medusa/clients/torrent/download_station_client.py</a>", line 124, in _add_torrent_uri
    log.debug('Add torrent URI with data: {}'.format(data))
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/logger/adapters/style.py#L89">SickBeard/medusa/logger/adapters/style.py</a>", line 89, in log
    self.logger.log(level, brace_msg, **kwargs)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 1489, in log
    self.logger.log(level, msg, *args, **kwargs)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 1231, in log
    self._log(level, msg, args, **kwargs)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 1286, in _log
    self.handle(record)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 1296, in handle
    self.callHandlers(record)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 1336, in callHandlers
    hdlr.handle(record)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 759, in handle
    self.emit(record)
  File "/usr/local/python/lib/python2.7/logging/handlers.py", line 78, in emit
    logging.FileHandler.emit(self, record)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 957, in emit
    StreamHandler.emit(self, record)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 861, in emit
    msg = self.format(record)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 734, in format
    return fmt.format(record)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/logger/__init__.py#L546">SickBeard/medusa/logger/__init__.py</a>", line 546, in format
    msg = super(CensoredFormatter, self).format(record)
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 465, in format
    record.message = record.getMessage()
  File "/usr/local/python/lib/python2.7/logging/__init__.py", line 325, in getMessage
    msg = str(self.msg)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/init/logconfig.py#L80">SickBeard/medusa/init/logconfig.py</a>", line 80, in __str__
    result = text_type(self.fmt)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/logger/adapters/style.py#L49">SickBeard/medusa/logger/adapters/style.py</a>", line 49, in __str__
    ''.join(traceback.format_stack()),
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/logger/adapters/style.py#L39">SickBeard/medusa/logger/adapters/style.py</a>", line 39, in __str__
    return msg.format(*args, **kwargs)
KeyError: "u'version'"
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `medusa/logger/adapters/style.py`
Content:
```
1 # coding=utf-8
2 
3 """Style Adapters for Python logging."""
4 
5 from __future__ import unicode_literals
6 
7 import collections
8 import functools
9 import logging
10 import traceback
11 
12 from six import text_type
13 
14 log = logging.getLogger(__name__)
15 log.addHandler(logging.NullHandler())
16 
17 
18 class BraceMessage(object):
19     """Lazily convert a Brace-formatted message."""
20 
21     def __init__(self, msg, *args, **kwargs):
22         """Initialize a lazy-formatted message."""
23         self.msg = msg
24         self.args = args
25         self.kwargs = kwargs
26 
27     def __str__(self):
28         """Convert to string."""
29         args = self.args
30         kwargs = self.kwargs
31         if args and len(args) == 1:
32             if args[0] and isinstance(args[0], collections.Mapping):
33                 args = []
34                 kwargs = self.args[0]
35 
36         msg = text_type(self.msg)
37 
38         try:
39             return msg.format(*args, **kwargs)
40         except IndexError:
41             try:
42                 return msg.format(kwargs)
43             except IndexError:
44                 return msg
45         except Exception:
46             log.error(
47                 'BraceMessage string formatting failed. '
48                 'Using representation instead.\n{0}'.format(
49                     ''.join(traceback.format_stack()),
50                 )
51             )
52             return repr(self)
53 
54     def __repr__(self):
55         """Convert to class representation."""
56         sep = ', '
57         kw_repr = '{key}={value!r}'
58         name = self.__class__.__name__
59         args = sep.join(map(text_type, self.args))
60         kwargs = sep.join(kw_repr.format(key=k, value=v)
61                           for k, v in self.kwargs.items())
62         return '{cls}({args})'.format(
63             cls=name,
64             args=sep.join([repr(self.msg), args, kwargs])
65         )
66 
67     def format(self, *args, **kwargs):
68         """Format a BraceMessage string."""
69         return str(self).format(*args, **kwargs)
70 
71 
72 class BraceAdapter(logging.LoggerAdapter):
73     """Adapt logger to use Brace-formatted messages."""
74 
75     def __init__(self, logger, extra=None):
76         """Initialize the Brace adapter with a logger."""
77         super(BraceAdapter, self).__init__(logger, extra)
78         self.debug = functools.partial(self.log, logging.DEBUG)
79         self.info = functools.partial(self.log, logging.INFO)
80         self.warning = functools.partial(self.log, logging.WARNING)
81         self.error = functools.partial(self.log, logging.ERROR)
82         self.critical = functools.partial(self.log, logging.CRITICAL)
83 
84     def log(self, level, msg, *args, **kwargs):
85         """Log a message at the specified level using Brace-formatting."""
86         if self.isEnabledFor(level):
87             msg, kwargs = self.process(msg, kwargs)
88             brace_msg = BraceMessage(msg, *args, **kwargs)
89             self.logger.log(level, brace_msg, **kwargs)
90 
91     def exception(self, msg, *args, **kwargs):
92         """Add exception information before delegating to self.log."""
93         kwargs['exc_info'] = 1
94         self.log(logging.ERROR, msg, *args, **kwargs)
95
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/medusa/logger/adapters/style.py b/medusa/logger/adapters/style.py
--- a/medusa/logger/adapters/style.py
+++ b/medusa/logger/adapters/style.py
@@ -33,15 +33,15 @@
                 args = []
                 kwargs = self.args[0]
 
-        msg = text_type(self.msg)
-
         try:
-            return msg.format(*args, **kwargs)
+            return self.msg.format(*args, **kwargs)
         except IndexError:
             try:
-                return msg.format(kwargs)
-            except IndexError:
-                return msg
+                return self.msg.format(**kwargs)
+            except KeyError:
+                return self.msg
+        except KeyError:
+            return self.msg.format(*args)
         except Exception:
             log.error(
                 'BraceMessage string formatting failed. '
@@ -85,8 +85,9 @@
         """Log a message at the specified level using Brace-formatting."""
         if self.isEnabledFor(level):
             msg, kwargs = self.process(msg, kwargs)
-            brace_msg = BraceMessage(msg, *args, **kwargs)
-            self.logger.log(level, brace_msg, **kwargs)
+            if not isinstance(msg, BraceMessage):
+                msg = BraceMessage(msg, *args, **kwargs)
+            self.logger.log(level, msg, **kwargs)
 
     def exception(self, msg, *args, **kwargs):
         """Add exception information before delegating to self.log."""

{"golden_diff": "diff --git a/medusa/logger/adapters/style.py b/medusa/logger/adapters/style.py\n--- a/medusa/logger/adapters/style.py\n+++ b/medusa/logger/adapters/style.py\n@@ -33,15 +33,15 @@\n                 args = []\n                 kwargs = self.args[0]\n \n-        msg = text_type(self.msg)\n-\n         try:\n-            return msg.format(*args, **kwargs)\n+            return self.msg.format(*args, **kwargs)\n         except IndexError:\n             try:\n-                return msg.format(kwargs)\n-            except IndexError:\n-                return msg\n+                return self.msg.format(**kwargs)\n+            except KeyError:\n+                return self.msg\n+        except KeyError:\n+            return self.msg.format(*args)\n         except Exception:\n             log.error(\n                 'BraceMessage string formatting failed. '\n@@ -85,8 +85,9 @@\n         \"\"\"Log a message at the specified level using Brace-formatting.\"\"\"\n         if self.isEnabledFor(level):\n             msg, kwargs = self.process(msg, kwargs)\n-            brace_msg = BraceMessage(msg, *args, **kwargs)\n-            self.logger.log(level, brace_msg, **kwargs)\n+            if not isinstance(msg, BraceMessage):\n+                msg = BraceMessage(msg, *args, **kwargs)\n+            self.logger.log(level, msg, **kwargs)\n \n     def exception(self, msg, *args, **kwargs):\n         \"\"\"Add exception information before delegating to self.log.\"\"\"\n", "issue": "[APP SUBMITTED]: KeyError: \"u'version'\"\n\n### INFO\n**Python Version**: `2.7.13 (default, Dec 18 2016, 21:23:50) [GCC 4.6.4]`\n**Operating System**: `Linux-3.2.40-armv7l-with-glibc2.4`\n**Locale**: `UTF-8`\n**Branch**: [master](../tree/master)\n**Database**: `44.8`\n**Commit**: pymedusa/Medusa@7b9111eef5836a6846499ef257ffff3f1f35df8f\n**Link to Log**: https://gist.github.com/adaeb1415fefd1083f59da7f01134ac6\n### ERROR\n<pre>\n2017-12-29 19:52:25 ERROR    FINDPROPERS :: [7b9111e] BraceMessage string formatting failed. Using representation instead.\n  File \"/usr/local/python/lib/python2.7/threading.py\", line 774, in __bootstrap\n    self.__bootstrap_inner()\n  File \"/usr/local/python/lib/python2.7/threading.py\", line 801, in __bootstrap_inner\n    self.run()\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/scheduler.py#L90\">SickBeard/medusa/scheduler.py</a>\", line 90, in run\n    self.action.run(self.force)\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/search/proper.py#L65\">SickBeard/medusa/search/proper.py</a>\", line 65, in run\n    self._download_propers(propers)\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/search/proper.py#L353\">SickBeard/medusa/search/proper.py</a>\", line 353, in _download_propers\n    snatch_episode(cur_proper)\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/search/core.py#L159\">SickBeard/medusa/search/core.py</a>\", line 159, in snatch_episode\n    result_downloaded = client.send_torrent(result)\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/clients/torrent/generic.py#L254\">SickBeard/medusa/clients/torrent/generic.py</a>\", line 254, in send_torrent\n    r_code = self._add_torrent_uri(result)\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/clients/torrent/download_station_client.py#L124\">SickBeard/medusa/clients/torrent/download_station_client.py</a>\", line 124, in _add_torrent_uri\n    log.debug('Add torrent URI with data: {}'.format(data))\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/logger/adapters/style.py#L89\">SickBeard/medusa/logger/adapters/style.py</a>\", line 89, in log\n    self.logger.log(level, brace_msg, **kwargs)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 1489, in log\n    self.logger.log(level, msg, *args, **kwargs)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 1231, in log\n    self._log(level, msg, args, **kwargs)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 1286, in _log\n    self.handle(record)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 1296, in handle\n    self.callHandlers(record)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 1336, in callHandlers\n    hdlr.handle(record)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 759, in handle\n    self.emit(record)\n  File \"/usr/local/python/lib/python2.7/logging/handlers.py\", line 78, in emit\n    logging.FileHandler.emit(self, record)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 957, in emit\n    StreamHandler.emit(self, record)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 861, in emit\n    msg = self.format(record)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 734, in format\n    return fmt.format(record)\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/logger/__init__.py#L546\">SickBeard/medusa/logger/__init__.py</a>\", line 546, in format\n    msg = super(CensoredFormatter, self).format(record)\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 465, in format\n    record.message = record.getMessage()\n  File \"/usr/local/python/lib/python2.7/logging/__init__.py\", line 325, in getMessage\n    msg = str(self.msg)\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/init/logconfig.py#L80\">SickBeard/medusa/init/logconfig.py</a>\", line 80, in __str__\n    result = text_type(self.fmt)\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/logger/adapters/style.py#L49\">SickBeard/medusa/logger/adapters/style.py</a>\", line 49, in __str__\n    ''.join(traceback.format_stack()),\nTraceback (most recent call last):\n  File \"/volume1/@appstore/sickbeard-custom/var/<a href=\"../blob/7b9111eef5836a6846499ef257ffff3f1f35df8f/SickBeard/medusa/logger/adapters/style.py#L39\">SickBeard/medusa/logger/adapters/style.py</a>\", line 39, in __str__\n    return msg.format(*args, **kwargs)\nKeyError: \"u'version'\"\n</pre>\n---\n_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators\n\n", "before_files": [{"content": "# coding=utf-8\n\n\"\"\"Style Adapters for Python logging.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport collections\nimport functools\nimport logging\nimport traceback\n\nfrom six import text_type\n\nlog = logging.getLogger(__name__)\nlog.addHandler(logging.NullHandler())\n\n\nclass BraceMessage(object):\n    \"\"\"Lazily convert a Brace-formatted message.\"\"\"\n\n    def __init__(self, msg, *args, **kwargs):\n        \"\"\"Initialize a lazy-formatted message.\"\"\"\n        self.msg = msg\n        self.args = args\n        self.kwargs = kwargs\n\n    def __str__(self):\n        \"\"\"Convert to string.\"\"\"\n        args = self.args\n        kwargs = self.kwargs\n        if args and len(args) == 1:\n            if args[0] and isinstance(args[0], collections.Mapping):\n                args = []\n                kwargs = self.args[0]\n\n        msg = text_type(self.msg)\n\n        try:\n            return msg.format(*args, **kwargs)\n        except IndexError:\n            try:\n                return msg.format(kwargs)\n            except IndexError:\n                return msg\n        except Exception:\n            log.error(\n                'BraceMessage string formatting failed. '\n                'Using representation instead.\\n{0}'.format(\n                    ''.join(traceback.format_stack()),\n                )\n            )\n            return repr(self)\n\n    def __repr__(self):\n        \"\"\"Convert to class representation.\"\"\"\n        sep = ', '\n        kw_repr = '{key}={value!r}'\n        name = self.__class__.__name__\n        args = sep.join(map(text_type, self.args))\n        kwargs = sep.join(kw_repr.format(key=k, value=v)\n                          for k, v in self.kwargs.items())\n        return '{cls}({args})'.format(\n            cls=name,\n            args=sep.join([repr(self.msg), args, kwargs])\n        )\n\n    def format(self, *args, **kwargs):\n        \"\"\"Format a BraceMessage string.\"\"\"\n        return str(self).format(*args, **kwargs)\n\n\nclass BraceAdapter(logging.LoggerAdapter):\n    \"\"\"Adapt logger to use Brace-formatted messages.\"\"\"\n\n    def __init__(self, logger, extra=None):\n        \"\"\"Initialize the Brace adapter with a logger.\"\"\"\n        super(BraceAdapter, self).__init__(logger, extra)\n        self.debug = functools.partial(self.log, logging.DEBUG)\n        self.info = functools.partial(self.log, logging.INFO)\n        self.warning = functools.partial(self.log, logging.WARNING)\n        self.error = functools.partial(self.log, logging.ERROR)\n        self.critical = functools.partial(self.log, logging.CRITICAL)\n\n    def log(self, level, msg, *args, **kwargs):\n        \"\"\"Log a message at the specified level using Brace-formatting.\"\"\"\n        if self.isEnabledFor(level):\n            msg, kwargs = self.process(msg, kwargs)\n            brace_msg = BraceMessage(msg, *args, **kwargs)\n            self.logger.log(level, brace_msg, **kwargs)\n\n    def exception(self, msg, *args, **kwargs):\n        \"\"\"Add exception information before delegating to self.log.\"\"\"\n        kwargs['exc_info'] = 1\n        self.log(logging.ERROR, msg, *args, **kwargs)\n", "path": "medusa/logger/adapters/style.py"}], "after_files": [{"content": "# coding=utf-8\n\n\"\"\"Style Adapters for Python logging.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport collections\nimport functools\nimport logging\nimport traceback\n\nfrom six import text_type\n\nlog = logging.getLogger(__name__)\nlog.addHandler(logging.NullHandler())\n\n\nclass BraceMessage(object):\n    \"\"\"Lazily convert a Brace-formatted message.\"\"\"\n\n    def __init__(self, msg, *args, **kwargs):\n        \"\"\"Initialize a lazy-formatted message.\"\"\"\n        self.msg = msg\n        self.args = args\n        self.kwargs = kwargs\n\n    def __str__(self):\n        \"\"\"Convert to string.\"\"\"\n        args = self.args\n        kwargs = self.kwargs\n        if args and len(args) == 1:\n            if args[0] and isinstance(args[0], collections.Mapping):\n                args = []\n                kwargs = self.args[0]\n\n        try:\n            return self.msg.format(*args, **kwargs)\n        except IndexError:\n            try:\n                return self.msg.format(**kwargs)\n            except KeyError:\n                return self.msg\n        except KeyError:\n            return self.msg.format(*args)\n        except Exception:\n            log.error(\n                'BraceMessage string formatting failed. '\n                'Using representation instead.\\n{0}'.format(\n                    ''.join(traceback.format_stack()),\n                )\n            )\n            return repr(self)\n\n    def __repr__(self):\n        \"\"\"Convert to class representation.\"\"\"\n        sep = ', '\n        kw_repr = '{key}={value!r}'\n        name = self.__class__.__name__\n        args = sep.join(map(text_type, self.args))\n        kwargs = sep.join(kw_repr.format(key=k, value=v)\n                          for k, v in self.kwargs.items())\n        return '{cls}({args})'.format(\n            cls=name,\n            args=sep.join([repr(self.msg), args, kwargs])\n        )\n\n    def format(self, *args, **kwargs):\n        \"\"\"Format a BraceMessage string.\"\"\"\n        return str(self).format(*args, **kwargs)\n\n\nclass BraceAdapter(logging.LoggerAdapter):\n    \"\"\"Adapt logger to use Brace-formatted messages.\"\"\"\n\n    def __init__(self, logger, extra=None):\n        \"\"\"Initialize the Brace adapter with a logger.\"\"\"\n        super(BraceAdapter, self).__init__(logger, extra)\n        self.debug = functools.partial(self.log, logging.DEBUG)\n        self.info = functools.partial(self.log, logging.INFO)\n        self.warning = functools.partial(self.log, logging.WARNING)\n        self.error = functools.partial(self.log, logging.ERROR)\n        self.critical = functools.partial(self.log, logging.CRITICAL)\n\n    def log(self, level, msg, *args, **kwargs):\n        \"\"\"Log a message at the specified level using Brace-formatting.\"\"\"\n        if self.isEnabledFor(level):\n            msg, kwargs = self.process(msg, kwargs)\n            if not isinstance(msg, BraceMessage):\n                msg = BraceMessage(msg, *args, **kwargs)\n            self.logger.log(level, msg, **kwargs)\n\n    def exception(self, msg, *args, **kwargs):\n        \"\"\"Add exception information before delegating to self.log.\"\"\"\n        kwargs['exc_info'] = 1\n        self.log(logging.ERROR, msg, *args, **kwargs)\n", "path": "medusa/logger/adapters/style.py"}]}