Skip to content

Commit

Permalink
Merge e81a99c into 906ae98
Browse files Browse the repository at this point in the history
  • Loading branch information
gnulnx committed Jan 10, 2019
2 parents 906ae98 + e81a99c commit b28d34f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change Log
==========

V0.9.2
------
* Better misconfiguration exception messages and exception classes.

V0.9.1
------
* Fixed syntax error in README>rst
Expand Down
4 changes: 4 additions & 0 deletions mongolog/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
class MissingConnectionError(ValueError):
def __init__(self, *args, **kwargs):
ValueError.__init__(self, *args, **kwargs)


class LogConfigError(ValueError):
pass
7 changes: 5 additions & 2 deletions mongolog/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from pymongo.collection import ReturnDocument

from mongolog.models import LogRecord
from mongolog.exceptions import MissingConnectionError
from mongolog.exceptions import MissingConnectionError, LogConfigError

logger = logging.getLogger('')
console = logging.getLogger('mongolog-int')
Expand Down Expand Up @@ -71,7 +71,10 @@ def get_mongolog_handler(logger_name=None, show_logger_names=False):
break

if not handler:
raise ValueError("No BaseMongoLogHandler could be found. Did you add on to youy logging config?")
if logger_name:
raise LogConfigError("logger '%s' does not have a mongolog based handler associated with it." % logger_name)

raise LogConfigError("There are no loggers with a mongolog based handler. Please see documentation about setting up LOGGING.")
return handler


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from setuptools import setup

VERSION = "0.9.1"
VERSION = "0.9.2"

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
Expand Down

0 comments on commit b28d34f

Please sign in to comment.