58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | |
def get_consumer(self, keywords): |
""" return a consumer matching keywords |
|
tries to find the most suitable consumer by walking, starting from |
the back, the list of keywords, the first consumer matching a |
keyword is returned (falling back to py.log.default) |
""" |
for i in range(len(self.keywords), 0, -1): |
try: |
return self.keywords2consumer[self.keywords[:i]] |
except KeyError: |
continue |
return self.keywords2consumer.get('default', default_consumer) | |