Changeset - 0d4dd9380a45
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 9 years ago 2017-03-20 21:06:31
thomas.de.schampheleire@gmail.com
config: activate logging on 'gearbox serve'

With the switch from paster to gearbox, early logging did not show on the
console anymore. This includes the initialization logging of TurboGears2.

For our own gearbox commands, the activation of logging is done in
kallithea/lib/paster_commands/common.py:_bootstrap_config, but for 'serve'
this method is not used. 'gearbox serve' immediately runs the
'paste.app_factory' specified in setup.py, which is make_app.

Extend make_app with logging initialization in the same way as is done in
_bootstrap_config.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/config/middleware.py
Show inline comments
 
@@ -13,6 +13,7 @@
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
"""WSGI middleware initialization for the Kallithea application."""
 

	
 
import logging
 
from kallithea.config.app_cfg import base_config
 
from kallithea.config.environment import load_environment
 

	
 
@@ -41,5 +42,6 @@ def make_app(global_conf, full_stack=Tru
 
    ``app_conf`` contains all the application-specific settings (those defined
 
    under ``[app:main]``.
 
    """
 
    logging.config.fileConfig(global_conf['__file__'])
 
    app = make_base_app(global_conf, full_stack=full_stack, **app_conf)
 
    return app
0 comments (0 inline, 0 general)