Use a class provided logger before falling back to module
If a subclass overrides the logging listeners and provides a class specific logger (under the attribute named _LOGGER) try to use that before using the taskflow specific logging module (and only use this one as a last resort). This allows subclasses to easily override the default logger without having to continually pass in a constructor argument to do the same. Change-Id: I91fea3db6cdd1dfb39963ff9589fd530fe087278
This commit is contained in:
@@ -112,6 +112,14 @@ def find_subclasses(locations, base_cls, exclude_hidden=True):
|
||||
return derived
|
||||
|
||||
|
||||
def pick_first_not_none(*values):
|
||||
"""Returns first of values that is *not* None (or None if all are/were)."""
|
||||
for val in values:
|
||||
if val is not None:
|
||||
return val
|
||||
return None
|
||||
|
||||
|
||||
def parse_uri(uri):
|
||||
"""Parses a uri into its components."""
|
||||
# Do some basic validation before continuing...
|
||||
|
||||
Reference in New Issue
Block a user