Skip to content

Commit

Permalink
Merge pull request #5 from backpacker69/master
Browse files Browse the repository at this point in the history
logging configuration initialized
  • Loading branch information
peerchemist authored Mar 3, 2017
2 parents 53ebd70 + 80fb7d8 commit 9e5068d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pacli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os, argparse
import pypeerassets as pa
import json
import logging

conf_dir = user_config_dir("pacli")
conf_file = os.path.join(conf_dir, "pacli.conf")
Expand All @@ -20,6 +21,11 @@ def load_conf():
for key in user_config:
setattr(Settings, key, user_config[key])

logging.basicConfig(level=logging.getLevelName(Settings.loglevel),
format="%(asctime)s %(levelname)s %(message)s")

logging.debug("logging initialized")

def first_run():
'''if first run, setup local configuration directory.'''

Expand Down
1 change: 1 addition & 0 deletions pacli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def read_conf(conf_file):
settings = {
"network": config["settings"]["network"],
"production": config["settings"]["production"],
"loglevel": config["settings"]["loglevel"],
"change": config["settings"]["change"]
}

Expand Down
4 changes: 2 additions & 2 deletions pacli/default_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
default_conf = {
"network": "tppc",
"production": True,
"change": "default"
#"loglevel": "debug"
"change": "default",
"loglevel": "WARNING" # WARNING, INFO, DEBUG
}

0 comments on commit 9e5068d

Please sign in to comment.