Fix level enum checking 01/601/1
authorRoni Riska <roni.riska@nokia.com>
Wed, 31 Jul 2019 11:10:16 +0000 (14:10 +0300)
committerRoni Riska <roni.riska@nokia.com>
Wed, 31 Jul 2019 11:17:54 +0000 (14:17 +0300)
commit644e53733c9f9c79a9da381f2248c60642db8be1
tree306b849adf3de26153b3810948ac0e4f19952bbb
parentf1168469f30cf94904af077ad21fde25e6793ce8
Fix level enum checking

In Python 3.8 checks with non-Enum causes TypeError exception.
https://docs.python.org/3/whatsnew/3.7.html#enum

So, if the library user would call mdclog.set_level(123)
it would crash the process with Python 3.8. With 3.7 it would
just cause an error print and with older nothing would happen.

Now we try to convert the set_level argument to a Level object
and if it does not succeed then ignore the setting, like
it has worked with older Python versions.

Change-Id: Ib99d5feb8eea919ffc9cd12405aac6da892f6d14
Signed-off-by: Roni Riska <roni.riska@nokia.com>
mdclogpy/Logger.py