Skip to content

Commit

Permalink
Added parameterizable log level. Fixed setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvaughn committed Apr 16, 2018
1 parent 58a91d1 commit 40764a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion agavedb/keyval.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AgaveKeyValStore(object):

"""An AgaveKeyValStore instance. Requires an active Agave client"""

def __init__(self, agaveClient, prefix=_PREFIX):
def __init__(self, agaveClient, prefix=_PREFIX, loglevel='INFO'):
"""
Initialize a AgaveKeyValStore object
Expand All @@ -61,6 +61,7 @@ def __init__(self, agaveClient, prefix=_PREFIX):
Keyword parameters:
prefix - str - Optional override for key prefix
loglevel - Set the logging level. DEBUG is good for diagnosing issues.
Returns:
- AgaveKeyValStore
Expand All @@ -70,6 +71,7 @@ def __init__(self, agaveClient, prefix=_PREFIX):
FORMAT = "%(asctime)s [%(levelname)s] - %(message)s"
DATEFORMAT = "%Y-%m-%dT%H:%M:%SZ"
self.logging = logging.getLogger('AgaveKeyValStore')
self.logging.setLevel(loglevel)
stderrLogger = logging.StreamHandler()
stderrLogger.setFormatter(
logging.Formatter(FORMAT, datefmt=DATEFORMAT))
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
name='agavedb',
packages=['agavedb'],
version=__version__,
long_description=readme,
install_requires=requires,
description='Multiuser-aware key/value store built atop AgaveAPI metadata',
long_description=readme(),
author='Matthew W. Vaughn',
author_email='vaughn@tacc.utexas.edu',
url='https://github.com/TACC/agavedb',
package_dir={'agavedb': 'agavedb'},
data_files=[('', ['requirements-travis.txt', 'requirements.txt'])],
install_requires=requires(),
license="BSD",
keywords='',
classifiers=[
Expand Down

0 comments on commit 40764a9

Please sign in to comment.