Skip to content

Commit

Permalink
disable logging only for Timeloop instances, not the root logger; fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Jun 10, 2021
1 parent ed6b0ba commit 4eeda1f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 4 additions & 0 deletions src/pypath/inputs/humap.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def humap2_complexes(min_confidence = 0):
for uniprot in l[2].split()
)):

if not uniprots:

continue

cplex = intera.Complex(
components = uniprots,
sources = 'hu.MAP2',
Expand Down
3 changes: 2 additions & 1 deletion src/pypath/inputs/uniprot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import datetime
import collections
import itertools

import timeloop
timeloop.app.logging.disable(level = 9999)

import pypath.resources.urls as urls
import pypath.share.curl as curl
Expand Down Expand Up @@ -171,6 +171,7 @@ def is_trembl(name, organism = 9606):


_cleanup_timeloop = timeloop.Timeloop()
_cleanup_timeloop.logger.setLevel(9999)

@_cleanup_timeloop.job(
interval = datetime.timedelta(
Expand Down
4 changes: 1 addition & 3 deletions src/pypath/share/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
import datetime

import timeloop
# we use this for simple little tasks only
# and don't want engage another logger
timeloop.app.logging.disable(level=9999)

import pypath.share.settings as settings

Expand All @@ -38,6 +35,7 @@


_log_flush_timeloop = timeloop.Timeloop()
_log_flush_timeloop.logger.setLevel(9999)


def new_logger(name = None, logdir = None, verbosity = None, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion src/pypath/utils/homology.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
import pypath.utils.taxonomy as taxonomy
import pypath.share.cache as cache_mod

timeloop.app.logging.disable(level = 9999)
_homology_cleanup_timeloop = timeloop.Timeloop()
_homology_cleanup_timeloop.logger.setLevel(9999)

_logger = session_mod.Logger(name = 'homology')
_log = _logger._log
Expand Down
4 changes: 1 addition & 3 deletions src/pypath/utils/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
import pickle

import timeloop
# we use this for simple little tasks only
# and don't want engage another logger
timeloop.app.logging.disable(level = 9999)

# from pypath:
import pypath.share.progress as progress
Expand Down Expand Up @@ -955,6 +952,7 @@ def __init__(
)

self._mapper_cleanup_timeloop = timeloop.Timeloop()
self._mapper_cleanup_timeloop.logger.setLevel(9999)

for job in self._mapper_cleanup_timeloop.jobs:

Expand Down
6 changes: 2 additions & 4 deletions src/pypath/utils/reflists.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@
import json
import datetime
import time
import timeloop

try:
import cPickle as pickle

except ImportError:
import pickle

# we use this for simple little tasks only
# and don't want engage another logger
timeloop.app.logging.disable(level = 9999)
import timeloop

import pypath.inputs.uniprot as uniprot_input
import pypath.inputs.mirbase as mirbase_input
Expand All @@ -56,6 +53,7 @@


_reflists_cleanup_timeloop = timeloop.Timeloop()
_reflists_cleanup_timeloop.logger.setLevel(9999)


class ReferenceListManager(session_mod.Logger):
Expand Down
3 changes: 2 additions & 1 deletion src/pypath/utils/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

import time
import datetime

import timeloop
timeloop.app.logging.disable(level = 9999)

import pypath.share.common as common
import pypath.share.session as session
Expand Down Expand Up @@ -290,6 +290,7 @@ def uniprot_taxid(uniprot):


_cleanup_timeloop = timeloop.Timeloop()
_cleanup_timeloop.logger.setLevel(9999)

@_cleanup_timeloop.job(
interval = datetime.timedelta(
Expand Down

0 comments on commit 4eeda1f

Please sign in to comment.