Initial commit

This commit is contained in:
askiiart 2024-01-31 18:22:20 -06:00
commit b7c5b751ea
Signed by untrusted user who does not match committer: askiiart
GPG key ID: BC3800E55FB54D67
2 changed files with 16 additions and 0 deletions

9
README.md Normal file
View file

@ -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.

7
logging_template.py Normal file
View file

@ -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')