Skip to content

Commit

Permalink
- remove module from log path, fixes #23
Browse files Browse the repository at this point in the history
- update docs
  • Loading branch information
cbess committed Feb 11, 2016
1 parent dc2d8b6 commit 8f2aea9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions example.local_settings.yml
@@ -1,5 +1,6 @@
# settings overrides
# Make a copy of this file and rename it to `local_settings.yml`
# see `/settings.py` for documentation and possible values
# online yaml parser: http://yaml-online-parser.appspot.com/

# A value indicating whether the app runs in debug mode.
Expand Down
11 changes: 6 additions & 5 deletions settings.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
Created by Christopher Bess (https://github.com/cbess/text-sherlock)
Copyright 2013
Copyright 2013
"""
import os

Expand All @@ -15,7 +15,7 @@
from app_args import get_options
try:
import yaml

# Try to load local settings (given path first, then relative/local), which override the default settings.
# In local_settings.yml, set the values for any settings you want to override.
default_yaml_path = os.path.join(ROOT_DIR, 'local_settings.yml')
Expand All @@ -27,16 +27,16 @@
else:
print 'No yaml config'
print 'Setup the local_settings.yml config.'

# try to load the config
if yaml_path and os.path.isfile(yaml_path):
config = yaml.load(open(yaml_path, 'r'))

if config:
print 'Loaded Sherlock config settings from %s' % yaml_path
except ImportError:
print 'No yaml lib: pip install pyyaml'

# `%(sherlock_dir)s` resolves to the directory where sherlock is installed.

# A value indicating whether the app runs in debug mode.
Expand Down Expand Up @@ -172,4 +172,5 @@
from local_settings import *
print '!!!Deprecated local_settings.py|pyc file found: Use local_settings.yml instead.'
except ImportError:
# ignore import error, because it's deprecated
pass
5 changes: 3 additions & 2 deletions tests/__init__.py
Expand Up @@ -12,11 +12,12 @@
sherlock_logger = logging.getLogger('core.sherlock')
sherlock_logger.setLevel(logging.DEBUG)
filename = 'sherlock.tests.log.txt'
hdlr = None

if settings.LOG_PATH:
hdlr = logging.FileHandler(os.path.join(settings.LOG_PATH, filename, __name__))
hdlr = logging.FileHandler(os.path.join(settings.LOG_PATH, filename))
else:
hdlr = logging.StreamHandler(sys.__stdout__)

if hdlr:
sherlock_logger.addHandler(hdlr)

Expand Down

0 comments on commit 8f2aea9

Please sign in to comment.