add logger
This commit is contained in:
parent
249a85539d
commit
99cd3768e4
9
app.py
9
app.py
@ -1,10 +1,16 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import websockets
|
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
|
import websockets
|
||||||
|
|
||||||
clients = {}
|
clients = {}
|
||||||
vars = {}
|
vars = {}
|
||||||
|
|
||||||
|
logging.basicConfig(
|
||||||
|
format="%(asctime)s %(message)s",
|
||||||
|
level=logging.INFO,
|
||||||
|
)
|
||||||
|
|
||||||
async def handshake(ws,data):
|
async def handshake(ws,data):
|
||||||
project_id = data.get('project_id','')
|
project_id = data.get('project_id','')
|
||||||
user = data.get('user')
|
user = data.get('user')
|
||||||
@ -32,7 +38,6 @@ async def disconnect(project_id,ws):
|
|||||||
print(f"disconnecting {ws.host}:{ws.port}")
|
print(f"disconnecting {ws.host}:{ws.port}")
|
||||||
clients.get(project_id,[]).remove(ws)
|
clients.get(project_id,[]).remove(ws)
|
||||||
|
|
||||||
|
|
||||||
async def handler(ws, path):
|
async def handler(ws, path):
|
||||||
project_id = ""
|
project_id = ""
|
||||||
user = ""
|
user = ""
|
||||||
|
@ -5,5 +5,5 @@ cd $BASE
|
|||||||
git pull
|
git pull
|
||||||
python3 -m venv env
|
python3 -m venv env
|
||||||
source env/bin/activate
|
source env/bin/activate
|
||||||
pip3 install -r requirements.txt
|
pip3 install -U -r requirements.txt
|
||||||
python3 app.py
|
python3 app.py
|
@ -1,12 +1,12 @@
|
|||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
name="busybox $SVCNAME"
|
name="$SVCNAME"
|
||||||
command="/opt/webapp/app.sh"
|
command="/data/entrypoint.sh"
|
||||||
command_args=""
|
|
||||||
pidfile="/var/run/$SVCNAME.pid"
|
pidfile="/var/run/$SVCNAME.pid"
|
||||||
|
command_background="yes"
|
||||||
|
output_logger="/usr/bin/logger"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need net
|
need net
|
||||||
use dns
|
need dns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user