<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_app(app_name, app_setting, web_application_setting, mainfile, package_space):
 """insert current project root path into sys path """

    from turbo import log
    app_config.app_name = app_name
    app_config.app_setting = app_setting
    app_config.project_name = os.path.basename(get_base_dir(mainfile, 2))
    app_config.web_application_setting.update(web_application_setting)
    if app_setting.get('session_config'):
        app_config.session_config.update(app_setting['session_config'])
    log.getLogger(**app_setting.log)
    _install_app(package_space)