Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging configuration initialized #5

Merged
merged 2 commits into from
Mar 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}