feat: develop添加mylogger
This commit is contained in:
parent
be6d51af7d
commit
f6a99f542f
|
@ -2,6 +2,8 @@ from __future__ import absolute_import, unicode_literals
|
||||||
from celery import shared_task
|
from celery import shared_task
|
||||||
import subprocess
|
import subprocess
|
||||||
from server.settings import DATABASES, BACKUP_PATH, SH_PATH, SD_PWD
|
from server.settings import DATABASES, BACKUP_PATH, SH_PATH, SD_PWD
|
||||||
|
import logging
|
||||||
|
myLogger = logging.getLogger('log')
|
||||||
|
|
||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
|
@ -23,6 +25,7 @@ def backup_database():
|
||||||
@shared_task
|
@shared_task
|
||||||
def reload_server_git():
|
def reload_server_git():
|
||||||
command = "bash {}/git_server.sh".format(SH_PATH)
|
command = "bash {}/git_server.sh".format(SH_PATH)
|
||||||
|
myLogger.info(f"reload_server_git: {command}")
|
||||||
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
|
completed = subprocess.run(command, shell=True, capture_output=True, text=True)
|
||||||
if completed.returncode != 0:
|
if completed.returncode != 0:
|
||||||
return completed.stderr
|
return completed.stderr
|
||||||
|
|
Loading…
Reference in New Issue