Automated update of package.

This commit is contained in:
bot 2024-12-05 07:27:37 +00:00
parent 178c72404d
commit c93d588ff1
5 changed files with 42 additions and 20 deletions

View File

@ -10,3 +10,22 @@ Description-Content-Type: text/markdown
Requires-Dist: requests==2.32.3
Requires-Dist: aiohttp
Requires-Dist: app@ git+https://retoor.molodetz.nl/retoor/app.git
# Mololog
Mololog is a logging framework for python applications.
It contains three applications:
- mololog.serve
- mololog.test
- mololog.bench
## Running mololog server
```
mololog.serve --host=127.0.0.1 --port=3016 --db=mololog.db
```
## Implementation of logger in application
```
from mololog.client import patch
patch("https://your-logging-server.nl")
```

View File

@ -1,3 +1,4 @@
README.md
pyproject.toml
setup.cfg
src/mololog/__init__.py

View File

@ -1,6 +1,7 @@
import asyncio
import json
import uuid
import asyncio
from aiohttp import web
from app.app import Application as BaseApplication
@ -12,7 +13,6 @@ class Application(BaseApplication):
self.test = test
self.total_received = 0
super().__init__(*args, **kwargs)
self.middlewares.append(self.test_middleware)
@ -27,13 +27,11 @@ class Application(BaseApplication):
async def test_middleware(self, request, handler):
result = await handler(request)
if self.total_received == self.test:
await asyncio.create_task(self.exit_app())
return result
async def handle_emit(self, request):
data = await request.json()
for key, value in data.items():

16
test.py
View File

@ -1,21 +1,25 @@
import subprocess
import shlex
import subprocess
import time
processes = [
subprocess.Popen(shlex.split("./.venv/bin/mololog.serve --host=127.0.0.1 --port=3999 --db=':memory:' --test=3")),
subprocess.Popen(shlex.split("./.venv/bin/mololog.test --url=http://localhost:3999"))
subprocess.Popen(
shlex.split(
"./.venv/bin/mololog.serve --host=127.0.0.1 --port=3999 --db=':memory:' --test=3"
)
),
subprocess.Popen(
shlex.split("./.venv/bin/mololog.test --url=http://localhost:3999")
),
]
for process in processes:
while True:
process.poll()
if not process.returncode is None:
if process.returncode is not None:
if process.returncode != 0:
exit(process.returncode)
break
time.sleep(1)
print("Test sucess!")