another change in logging
This commit is contained in:
@@ -51,7 +51,7 @@ class Log:
|
|||||||
Logs info messages with validation step
|
Logs info messages with validation step
|
||||||
"""
|
"""
|
||||||
print(
|
print(
|
||||||
Log.OKBLUE + "{0:22}".format(msg) +
|
Log.OKBLUE + "{0:20}".format(msg) +
|
||||||
" [" + Log.ENDC + ".." + Log.OKBLUE + "]" + Log.ENDC, end=end)
|
" [" + Log.ENDC + ".." + Log.OKBLUE + "]" + Log.ENDC, end=end)
|
||||||
if log:
|
if log:
|
||||||
self.app.log.info(Log.OKBLUE + msg + Log.ENDC)
|
self.app.log.info(Log.OKBLUE + msg + Log.ENDC)
|
||||||
@@ -61,7 +61,7 @@ class Log:
|
|||||||
Logs info messages after validation step
|
Logs info messages after validation step
|
||||||
"""
|
"""
|
||||||
print(
|
print(
|
||||||
Log.OKBLUE + "{0:22}".format(msg) +
|
Log.OKBLUE + ("{0:20}".format(msg)) +
|
||||||
" [" + Log.ENDC + Log.OKGREEN + "OK" +
|
" [" + Log.ENDC + Log.OKGREEN + "OK" +
|
||||||
Log.ENDC + Log.OKBLUE + "]" + Log.ENDC, end=end)
|
Log.ENDC + Log.OKBLUE + "]" + Log.ENDC, end=end)
|
||||||
if log:
|
if log:
|
||||||
@@ -72,7 +72,7 @@ class Log:
|
|||||||
Logs info messages after validation step
|
Logs info messages after validation step
|
||||||
"""
|
"""
|
||||||
print(
|
print(
|
||||||
Log.OKBLUE + "{0:22}".format(msg) +
|
Log.OKBLUE + "{0:20}".format(msg) +
|
||||||
" [" + Log.ENDC + Log.FAIL + "OK" +
|
" [" + Log.ENDC + Log.FAIL + "OK" +
|
||||||
Log.ENDC + Log.OKBLUE + "]" + Log.ENDC, end=end)
|
Log.ENDC + Log.OKBLUE + "]" + Log.ENDC, end=end)
|
||||||
if log:
|
if log:
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ class WOService():
|
|||||||
Log.info(self, "Start : {0:10}" .format(service_name), end='')
|
Log.info(self, "Start : {0:10}" .format(service_name), end='')
|
||||||
retcode = subprocess.getstatusoutput(service_cmd)
|
retcode = subprocess.getstatusoutput(service_cmd)
|
||||||
if retcode[0] == 0:
|
if retcode[0] == 0:
|
||||||
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
|
Log.info(self, "[" + Log.ENDC + Log.OKGREEN +
|
||||||
|
"OK" + Log.ENDC + Log.OKBLUE + "]")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "{0}".format(retcode[1]))
|
Log.debug(self, "{0}".format(retcode[1]))
|
||||||
@@ -55,7 +56,7 @@ class WOService():
|
|||||||
Similar to `service xyz stop`
|
Similar to `service xyz stop`
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
Log.info(self, "Stop : {0:10}" .format(service_name), end='')
|
Log.info(self, "Stop : {0:10}" .format(service_name), end='')
|
||||||
retcode = subprocess.getstatusoutput('service {0} stop'
|
retcode = subprocess.getstatusoutput('service {0} stop'
|
||||||
.format(service_name))
|
.format(service_name))
|
||||||
if retcode[0] == 0:
|
if retcode[0] == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user