Write the given ``msg`` to the error log. This is not just for errors! Applications may call this at any time to log application-specific information. If ``traceback`` is True, the traceback of the current exception (if any) will be appended to ``msg``.
(self, msg='', context='', severity=logging.INFO,
traceback=False)
| 197 | h.release() |
| 198 | |
| 199 | def error(self, msg='', context='', severity=logging.INFO, |
| 200 | traceback=False): |
| 201 | """Write the given ``msg`` to the error log. |
| 202 | |
| 203 | This is not just for errors! Applications may call this at any time |
| 204 | to log application-specific information. |
| 205 | |
| 206 | If ``traceback`` is True, the traceback of the current exception |
| 207 | (if any) will be appended to ``msg``. |
| 208 | """ |
| 209 | exc_info = None |
| 210 | if traceback: |
| 211 | exc_info = _cperror._exc_info() |
| 212 | |
| 213 | self.error_log.log( |
| 214 | severity, |
| 215 | ' '.join((self.time(), context, msg)), |
| 216 | exc_info=exc_info, |
| 217 | ) |
| 218 | |
| 219 | def __call__(self, *args, **kwargs): |
| 220 | """An alias for ``error``.""" |