logging
This commit is contained in:
parent
f6dc4264cf
commit
618d212358
@ -1,7 +1,7 @@
|
|||||||
from www import app
|
from www import app
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True, use_reloader=False)
|
app.run(debug=True, use_reloader=False)
|
||||||
|
|||||||
@ -3,7 +3,7 @@ from www import app
|
|||||||
import archive.archive as archive
|
import archive.archive as archive
|
||||||
import config
|
import config
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import os, logging
|
import os, logging, time
|
||||||
|
|
||||||
lists_to_serve = archive.list_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password'])
|
lists_to_serve = archive.list_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password'])
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ def searh():
|
|||||||
if f_arg not in ['content', 'from']:
|
if f_arg not in ['content', 'from']:
|
||||||
return "field '" + f_arg + "' does not exist"
|
return "field '" + f_arg + "' does not exist"
|
||||||
|
|
||||||
print("annalen /search k_arg=" + k_arg + " l_arg=" + l_arg + " f_arg=" + f_arg)
|
logging.info("/search k_arg=" + k_arg + " l_arg=" + l_arg + " f_arg=" + f_arg)
|
||||||
|
|
||||||
lists = []
|
lists = []
|
||||||
if l_arg == "all":
|
if l_arg == "all":
|
||||||
@ -54,9 +54,6 @@ def searh():
|
|||||||
else:
|
else:
|
||||||
lists.append(l_arg)
|
lists.append(l_arg)
|
||||||
|
|
||||||
print(lists)
|
|
||||||
|
|
||||||
|
|
||||||
################################
|
################################
|
||||||
##
|
##
|
||||||
## need to cache all the below.....
|
## need to cache all the below.....
|
||||||
@ -67,6 +64,7 @@ def searh():
|
|||||||
|
|
||||||
logging.info("search keyword = " + k_arg)
|
logging.info("search keyword = " + k_arg)
|
||||||
|
|
||||||
|
|
||||||
for l in lists:
|
for l in lists:
|
||||||
|
|
||||||
with archive.Archive(l, config=config.db) as a:
|
with archive.Archive(l, config=config.db) as a:
|
||||||
@ -98,6 +96,8 @@ def searh():
|
|||||||
|
|
||||||
|
|
||||||
sorted_results = sorted(results, key=get_result_key)
|
sorted_results = sorted(results, key=get_result_key)
|
||||||
|
|
||||||
|
|
||||||
return jsonify(result=sorted_results)
|
return jsonify(result=sorted_results)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user