From b7c5b751ea13cccb918b7a7316748b7486a8e6dd Mon Sep 17 00:00:00 2001 From: askiiart Date: Wed, 31 Jan 2024 18:22:20 -0600 Subject: [PATCH] Initial commit --- README.md | 9 +++++++++ logging_template.py | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 README.md create mode 100644 logging_template.py 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')