commit b7c5b751ea13cccb918b7a7316748b7486a8e6dd Author: askiiart Date: Wed Jan 31 18:22:20 2024 -0600 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..76d78cb --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Updog logging template + +A basic example of a logging extension for [Updog](https://git.askiiart.net/askiiart/updog). And this is the only example/template extension that actually does anything useful! + +## Usage + +Arguments: + +- `file`: The absolute path to the log file. diff --git a/logging_template.py b/logging_template.py new file mode 100644 index 0000000..f474da0 --- /dev/null +++ b/logging_template.py @@ -0,0 +1,7 @@ +class LoggingTemplate: + # there's no close() and that might cause some issues + def __init__(self, arguments): + self.log_file = open(arguments['file'], 'wt') + + def log(self, service_name, code, status): + self.log_file.write(f'{service_name} {code}: {status}\n')