Skip to content

Commit

Permalink
Add log channels to utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
giffels committed May 13, 2020
1 parent 62cc56e commit 59b157a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tardis/utilities/asynccachemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import logging
import json

logger = logging.getLogger("cobald.runtime.tardis.utilities.asynccachemap")


class AsyncCacheMap(Mapping):
def __init__(self, update_coroutine, max_age: int = 60 * 15):
Expand Down Expand Up @@ -36,11 +38,11 @@ async def update_status(self) -> None:
try:
data = await self._update_coroutine()
except json.decoder.JSONDecodeError as je:
logging.error(
logger.error(
f"AsyncMap update_status failed: Could not decode json {je}"
)
except CommandExecutionFailure as cf:
logging.error(f"AsyncMap update_status failed: {cf}")
logger.error(f"AsyncMap update_status failed: {cf}")
else:
self._data = data
self._last_update = current_time
Expand Down

0 comments on commit 59b157a

Please sign in to comment.