MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit 6a2a886f authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

add --verbose

console log level:
 (default)    ->  WARNING
 -v/--verbose ->  INFO
 -d/--debug   ->  DEBUG

log files:
  /vol/log/controller.log   -> INFO
  /vol/log/debug.log        -> DEBUG  (disabled unless -d/--debug or
                               unless env var DEBUG is set)
parent 0e301e74
......@@ -20,10 +20,10 @@ def die(msg, *k):
sys.exit(1)
def init_logging(debug):
def init_logging(log_level):
logging.basicConfig(
level = logging.DEBUG if debug else logging.INFO,
format = "%(asctime)s %(levelname)-8s %(message)s",
level = min(log_level, logging.INFO),
format = "%(asctime)s %(levelname)-8s %(name)-24s %(message)s",
datefmt = "%Y-%b-%2d %H:%M:%S",
)
......@@ -42,7 +42,7 @@ def init_logging(debug):
backupCount = 52)) # keep 1 year of logs
# debug logs
if debug:
if log_level <= logging.DEBUG:
add_handler(logging.DEBUG, logging.handlers.TimedRotatingFileHandler(
"/vol/log/debug.log",
when = "D", # rotate every day
......@@ -79,17 +79,21 @@ def main():
return result
with get_envvar("DEBUG") as val:
debug = bool(int(val or 0))
log_level = logging.DEBUG if bool(int(val or 0)) else logging.WARNING
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--debug", action="store_true")
if parser.parse_args().debug:
debug = 2
console_handler = init_logging(debug)
console_handler.setLevel(logging.DEBUG if debug else logging.INFO)
parser.add_argument("-d", "--debug", action="store_true")
parser.add_argument("-v", "--verbose", action="store_true")
args = parser.parse_args()
if args.debug:
log_level = logging.DEBUG
if args.verbose:
log_level = min(log_level, logging.INFO)
console_handler = init_logging(log_level)
console_handler.setLevel(min(log_level, logging.INFO))
log.info("---- docker controller started ----")
log.info("debugging: %r", debug)
log.info("log level: %s", logging.getLevelName(log_level))
with get_envvar("PORT") as val:
......@@ -137,8 +141,8 @@ def main():
lock.acquire(timeout=10) or die("unable to lock %r (there is another running controller)", lockfile)
try:
log.info("---- docker controller ready ----")
if debug < 2:
console_handler.setLevel(logging.WARNING)
console_handler.setLevel(logging.DEBUG if args.debug else (
logging.INFO if args.verbose else logging.WARNING))
return controller.DockerController(docker_host, swarm_host, mysql_host,
port, registry, env, datastore_path, sandbox_path,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment