| |
@@ -24,6 +24,8 @@
|
| |
'''
|
| |
import functools
|
| |
import json
|
| |
+ import logging
|
| |
+ import logging.config
|
| |
import os
|
| |
import urllib
|
| |
from urllib.parse import parse_qs
|
| |
@@ -57,6 +59,9 @@
|
| |
INDEX = INDEX.replace('$PREFIX', CONFIG.get('PREFIX', ''))
|
| |
|
| |
|
| |
+ _log = logging.getLogger(__name__)
|
| |
+
|
| |
+
|
| |
def allows_jsonp(function):
|
| |
''' Add support for JSONP queries to the endpoint decorated. '''
|
| |
|
| |
@@ -206,6 +211,7 @@
|
| |
@asyncio.coroutine
|
| |
@allows_jsonp
|
| |
def get_pkg(request):
|
| |
+ _log.info('get_pkg %s', request)
|
| |
branch = request.match_info.get('branch')
|
| |
pretty = _get_pretty(request)
|
| |
name = request.match_info.get('name')
|
| |
@@ -226,6 +232,7 @@
|
| |
@asyncio.coroutine
|
| |
@allows_jsonp
|
| |
def get_src_pkg(request):
|
| |
+ _log.info('get_src_pkg %s', request)
|
| |
branch = request.match_info.get('branch')
|
| |
pretty = _get_pretty(request)
|
| |
name = request.match_info.get('name')
|
| |
@@ -245,6 +252,7 @@
|
| |
@asyncio.coroutine
|
| |
@allows_jsonp
|
| |
def get_pkg_files(request):
|
| |
+ _log.info('get_pkg_files %s', request)
|
| |
branch = request.match_info.get('branch')
|
| |
name = request.match_info.get('name')
|
| |
pretty = _get_pretty(request)
|
| |
@@ -277,6 +285,7 @@
|
| |
@asyncio.coroutine
|
| |
@allows_jsonp
|
| |
def get_pkg_changelog(request):
|
| |
+ _log.info('get_pkg_changelog %s', request)
|
| |
branch = request.match_info.get('branch')
|
| |
name = request.match_info.get('name')
|
| |
pretty = _get_pretty(request)
|
| |
@@ -310,6 +319,7 @@
|
| |
def list_branches(request):
|
| |
''' Return the list of all branches currently supported by mdapi
|
| |
'''
|
| |
+ _log.info('list_branches: %s', request)
|
| |
pretty = _get_pretty(request)
|
| |
output = sorted(list(set([
|
| |
# Remove the front part `mdapi-` and the end part -<type>.sqlite
|
| |
@@ -348,6 +358,7 @@
|
| |
''' Return the information about the packages having the specified
|
| |
action (provides, requires, obsoletes...)
|
| |
'''
|
| |
+ _log.info('process_dep %s: %s', action, request)
|
| |
branch = request.match_info.get('branch')
|
| |
pretty = _get_pretty(request)
|
| |
name = request.match_info.get('name')
|
| |
@@ -409,6 +420,7 @@
|
| |
|
| |
@asyncio.coroutine
|
| |
def index(request):
|
| |
+ _log.info('index %s', request)
|
| |
return web.Response(
|
| |
body=INDEX.encode('utf-8'),
|
| |
content_type='text/html',
|
| |
@@ -417,6 +429,9 @@
|
| |
|
| |
@asyncio.coroutine
|
| |
def init(loop):
|
| |
+ logging.basicConfig()
|
| |
+ logging.config.dictConfig(CONFIG.get('LOGGING') or {'version': 1})
|
| |
+
|
| |
app = web.Application(loop=loop)
|
| |
routes = []
|
| |
prefix = CONFIG.get('PREFIX', '')
|
| |
This allows to have a better idea of what is going on on the server
side of things as before it wasn't doing much or anything actually.
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr