# HG changeset patch # User Nicolas DURAND # Date 1420562603 -3600 # Node ID 511f3b94c61678149740bbb59b7678cd52b34888 # Parent e839084fb54a8869cc088355b1e0e95364f6219f Fix to logging format + Link to discussion + github logging message format diff -r e839084fb54a -r 511f3b94c616 src/catedit/__init__.py --- a/src/catedit/__init__.py Tue Jan 06 15:53:09 2015 +0100 +++ b/src/catedit/__init__.py Tue Jan 06 17:43:23 2015 +0100 @@ -46,17 +46,11 @@ # set up logging if app.config["LOGGING"]: file_handler = FileHandler(filename=app.config["LOG_FILE_PATH"]) - file_handler.setFormatter(Formatter(''' - Message type: %(levelname)s - Location: %(pathname)s:%(lineno)d - Module: %(module)s - Function: %(funcName)s - Time: %(asctime)s - - Message: - - %(message)s - ''')) + file_handler.setFormatter(Formatter( + '%(asctime)s %(levelname)s: %(message)s ' + '[in %(pathname)s:%(lineno)d]', + '%Y-%m-%d %H:%M:%S' + )) app.logger.addHandler(file_handler) app.logger.setLevel(app.config["LOGGING_LEVEL"]) diff -r e839084fb54a -r 511f3b94c616 src/catedit/persistence.py --- a/src/catedit/persistence.py Tue Jan 06 15:53:09 2015 +0100 +++ b/src/catedit/persistence.py Tue Jan 06 17:43:23 2015 +0100 @@ -195,8 +195,8 @@ ) logger.debug(str(ref_master)) except GitHubError as ghe: - logger.debug("GitHubError trying to get the reference \ - to the master branch") + logger.debug("GitHubError trying to get the reference " + + "to the master branch") logger.debug( "Endpoint: " + "repos/" @@ -218,8 +218,8 @@ ) logger.debug(str(last_commit_master)) except GitHubError as ghe: - logger.debug("GitHubError trying to get the commit associated \ - to the latest reference to the master branch") + logger.debug("GitHubError trying to get the commit associated " + + "to the latest reference to the master branch") logger.debug(ghe.response.text) logger.debug(str(github.get("rate_limit")["resources"])) @@ -235,9 +235,9 @@ ) logger.debug(str(last_commit_tree)) except GitHubError as ghe: - logger.debug("GitHubError trying to get the tree from the commit \ - associated to the latest reference to the master \ - branch") + logger.debug("GitHubError trying to get the tree from the commit " + + "associated to the latest reference to the master " + + "branch") logger.debug(ghe.response.text) logger.debug(str(github.get("rate_limit")["resources"])) @@ -292,8 +292,8 @@ break except GitHubError as ghe: logger.debug( - "GitHubError trying to post a new \ - blob with following data: " + "GitHubError trying to post a new" + + "blob with following data: " + str(new_blob_data) ) logger.debug(ghe.response.text) @@ -333,8 +333,8 @@ ) except GitHubError as ghe: logger.debug( - "GitHubError trying to post a new blob with following \ - data: " + "GitHubError trying to post a new blob with following" + + "data: " + str(new_blob_data) ) logger.debug(ghe.response.text) @@ -399,8 +399,8 @@ logger.debug(str(new_head)) except GitHubError as ghe: logger.debug( - "GitHubError trying to edit the head to the master branch \ - with the following data: " + "GitHubError trying to edit the head to the master branch" + + "with the following data: " + str(new_head_data) ) logger.debug(ghe.response.text) @@ -421,8 +421,8 @@ file_content = str(b64decode(filedict["content"]), "utf-8") except GitHubError as ghe: logger.debug("Github Error trying to get file: "+kwargs["name"]) - logger.debug("Github sent an error, if 404, either you may not \ - have access to the repository or it doesn't exist ") + logger.debug("Github sent an error, if 404, either you may not " + + "have access to the repository or it doesn't exist ") logger.debug(ghe.response.text) logger.debug(str(github.get("rate_limit")["resources"])) return file_content @@ -453,11 +453,11 @@ for github_file in files_in_repo] # logger.debug(filenames_list) except GitHubError as ghe: - logger.debug("Github Error trying to get the file list in the \ - category repository") - logger.debug("NOTE: Github sent an error, if 404 either you \ - may not have access to the repository or it doesn't \ - exist or there isn't any files in it") + logger.debug("Github Error trying to get the file list in the " + + "category repository") + logger.debug("NOTE: Github sent an error, if 404 either you " + + "may not have access to the repository or it " + + "doesn't exist or there isn't any files in it") logger.debug(ghe.response.text) logger.debug(str(github.get("rate_limit")["resources"])) diff -r e839084fb54a -r 511f3b94c616 src/catedit/templates/catrecap.html --- a/src/catedit/templates/catrecap.html Tue Jan 06 15:53:09 2015 +0100 +++ b/src/catedit/templates/catrecap.html Tue Jan 06 17:43:23 2015 +0100 @@ -168,5 +168,5 @@

Soumettre mes changements actuels :

{% endif %} -

Consulter l'historique des modifications :

+

Consulter l'historique des modifications :

{% endblock page_content %}