Compare commits

..

1 Commits

Author SHA1 Message Date
Tobias Hodapp 7e419ec995 Fixed spelling errors
Added documentation
Added log messages for dry run
2023-08-22 23:03:14 +02:00
1 changed files with 3 additions and 2 deletions

View File

@ -1,8 +1,8 @@
import json import json
import logging import logging
import os
import platform import platform
import time import time
import os
import requests import requests
@ -20,7 +20,7 @@ MONITOR_STATE_TO_LOKI = {
MAX_BUFFER_LINES = 100 MAX_BUFFER_LINES = 100
class Loki_log_buffer(): class Loki_log_buffer:
''' '''
A log buffer that allows to output the logs as loki requests in json. Allows A log buffer that allows to output the logs as loki requests in json. Allows
adding labels to the log stream and takes care of communication with loki. adding labels to the log stream and takes care of communication with loki.
@ -73,6 +73,7 @@ class Loki_log_buffer():
except requests.RequestException: except requests.RequestException:
logger.warning('Failed to upload logs to loki') logger.warning('Failed to upload logs to loki')
class Loki_log_handler(logging.Handler): class Loki_log_handler(logging.Handler):
''' '''
A log handler that sends logs to loki. A log handler that sends logs to loki.