prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Make access logging of admin server dependent on log level
  Currently, admin logs all access logs to the console, regardless of which log level is set.
  This is caused by starting gunicorn with `--access-logfile -`. This should be switched dependent on the log level set, e.g. on for levels >= INFO and off for <=WARNING
   
  
  </issue>
  <code>
  [start of core/admin/start.py]
  1 #!/usr/bin/python3
  2 
  3 import os
  4 
  5 os.system("flask mailu advertise")
  6 os.system("flask db upgrade")
  7 
  8 account = os.environ.get("INITIAL_ADMIN_ACCOUNT")
  9 domain = os.environ.get("INITIAL_ADMIN_DOMAIN")
  10 password = os.environ.get("INITIAL_ADMIN_PW")
  11 
  12 if account is not None and domain is not None and password is not None:
  13     mode = os.environ.get("INITIAL_ADMIN_MODE", default="ifmissing")
  14     os.system("flask mailu admin %s %s '%s' --mode %s" % (account, domain, password, mode))
  15 
  16 os.system("gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload 'mailu:create_app()'")
  17
  [end of core/admin/start.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/core/admin/start.py b/core/admin/start.py
  --- a/core/admin/start.py
  +++ b/core/admin/start.py
  @@ -1,6 +1,10 @@
   #!/usr/bin/python3
   
   import os
  +import logging as log
  +import sys
  +
  +log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "INFO"))
   
   os.system("flask mailu advertise")
   os.system("flask db upgrade")
  @@ -11,6 +15,14 @@
   
   if account is not None and domain is not None and password is not None:
       mode = os.environ.get("INITIAL_ADMIN_MODE", default="ifmissing")
  +    log.info("Creating initial admin accout %s@%s with mode %s",account,domain,mode)
       os.system("flask mailu admin %s %s '%s' --mode %s" % (account, domain, password, mode))
   
  -os.system("gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload 'mailu:create_app()'")
  +start_command="".join([
  +    "gunicorn -w 4 -b :80 ",
  +    "--access-logfile - " if (log.root.level<=log.INFO) else "",
  +    "--error-logfile - ",
  +    "--preload ",
  +    "'mailu:create_app()'"])
  +
  +os.system(start_command)
  
verification_info: {"golden_diff": "diff --git a/core/admin/start.py b/core/admin/start.py\n--- a/core/admin/start.py\n+++ b/core/admin/start.py\n@@ -1,6 +1,10 @@\n #!/usr/bin/python3\n \n import os\n+import logging as log\n+import sys\n+\n+log.basicConfig(stream=sys.stderr, level=os.environ.get(\"LOG_LEVEL\", \"INFO\"))\n \n os.system(\"flask mailu advertise\")\n os.system(\"flask db upgrade\")\n@@ -11,6 +15,14 @@\n \n if account is not None and domain is not None and password is not None:\n     mode = os.environ.get(\"INITIAL_ADMIN_MODE\", default=\"ifmissing\")\n+    log.info(\"Creating initial admin accout %s@%s with mode %s\",account,domain,mode)\n     os.system(\"flask mailu admin %s %s '%s' --mode %s\" % (account, domain, password, mode))\n \n-os.system(\"gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload 'mailu:create_app()'\")\n+start_command=\"\".join([\n+    \"gunicorn -w 4 -b :80 \",\n+    \"--access-logfile - \" if (log.root.level<=log.INFO) else \"\",\n+    \"--error-logfile - \",\n+    \"--preload \",\n+    \"'mailu:create_app()'\"])\n+\n+os.system(start_command)\n", "issue": "Make access logging of admin server dependent on log level\nCurrently, admin logs all access logs to the console, regardless of which log level is set.\r\nThis is caused by starting gunicorn with `--access-logfile -`. This should be switched dependent on the log level set, e.g. on for levels >= INFO and off for <=WARNING\r\n \n", "before_files": [{"content": "#!/usr/bin/python3\n\nimport os\n\nos.system(\"flask mailu advertise\")\nos.system(\"flask db upgrade\")\n\naccount = os.environ.get(\"INITIAL_ADMIN_ACCOUNT\")\ndomain = os.environ.get(\"INITIAL_ADMIN_DOMAIN\")\npassword = os.environ.get(\"INITIAL_ADMIN_PW\")\n\nif account is not None and domain is not None and password is not None:\n    mode = os.environ.get(\"INITIAL_ADMIN_MODE\", default=\"ifmissing\")\n    os.system(\"flask mailu admin %s %s '%s' --mode %s\" % (account, domain, password, mode))\n\nos.system(\"gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload 'mailu:create_app()'\")\n", "path": "core/admin/start.py"}]}