Python3 Migrate

This commit is contained in:
MariuszC
2020-01-18 20:01:00 +01:00
parent ea05af2d15
commit 6cd7e0fe44
691 changed files with 201846 additions and 598 deletions

View File

@@ -0,0 +1,14 @@
import contextlib
import logging
import time
from mopidy.internal import log
logger = logging.getLogger(__name__)
@contextlib.contextmanager
def time_logger(name, level=log.TRACE_LOG_LEVEL):
start = time.time()
yield
logger.log(level, "%s took %dms", name, (time.time() - start) * 1000)