Initial commit
This commit is contained in:
commit
b7c5b751ea
2 changed files with 16 additions and 0 deletions
9
README.md
Normal file
9
README.md
Normal 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
7
logging_template.py
Normal 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')
|
Loading…
Reference in a new issue