WIP
This commit is contained in:
@@ -43,6 +43,7 @@ class ADMain:
|
||||
if hasattr(self, 'ad'):
|
||||
self.ad.logger.info('Running asyncio event loop indefinitely...')
|
||||
self.run_context.loop.run_forever()
|
||||
self.ad.logger.debug('Gracefully stopped event loop')
|
||||
else:
|
||||
logging.error('Running ADMain without context manager')
|
||||
|
||||
@@ -59,7 +60,7 @@ if __name__ == '__main__':
|
||||
{
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'formatters': {'basic': {'style': '{', 'format': '[yellow]{name}[/] {message}'}},
|
||||
'formatters': {'basic': {'style': '{', 'format': '[yellow]{name:20}[/] {message}'}},
|
||||
'handlers': {
|
||||
'rich': {
|
||||
'()': 'rich.logging.RichHandler',
|
||||
@@ -69,9 +70,10 @@ if __name__ == '__main__':
|
||||
'markup': True
|
||||
}
|
||||
},
|
||||
'root': {'level': 'INFO', 'handlers': ['rich']},
|
||||
'root': {'level': 'DEBUG', 'handlers': ['rich']},
|
||||
}
|
||||
)
|
||||
|
||||
with ADMain('/conf/ad-test/conf/appdaemon.yaml') as main:
|
||||
main.run()
|
||||
main.ad.logger.debug('Exiting main context from with statement')
|
||||
|
||||
Reference in New Issue
Block a user