diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-10 17:50:14 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2013-01-22 09:30:43 (GMT) |
commit | 19db9c5e9aee6e9c66c4bfef1d496e9b090f3e4d (patch) | |
tree | 643ef70e5798076008a50cdacbfc0122b34adf49 /src | |
parent | 535460ef67808787d9aa0c55a4361f841fee897e (diff) |
Setup logging as soon as possible
So that we don't lose any traceback
Acked-by: Simon Schampijer <simon@laptop.org>
Diffstat (limited to 'src')
-rwxr-xr-x | src/jarabe/main.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/jarabe/main.py b/src/jarabe/main.py index 55c6b8c..0fc08f9 100755 --- a/src/jarabe/main.py +++ b/src/jarabe/main.py @@ -15,24 +15,27 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +from sugar3 import logger + +logger.cleanup() +logger.start('shell') + +import logging + +logging.debug('%r STARTUP: Starting the shell') + import os import sys -import time import subprocess import shutil +import time # Change the default encoding to avoid UnicodeDecodeError # http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038928.html reload(sys) sys.setdefaultencoding('utf-8') -if os.environ.get('SUGAR_LOGGER_LEVEL', '') == 'debug': - print '%r STARTUP: Starting the shell' % time.time() - sys.stdout.flush() - import gettext -import logging -import sys from gi.repository import GLib from gi.repository import GConf @@ -44,7 +47,6 @@ import dbus.glib from gi.repository import Wnck from sugar3 import env -from sugar3 import logger from jarabe.model.session import get_session_manager from jarabe.model import screen @@ -199,9 +201,6 @@ def main(): cleanup_temporary_files() - logger.cleanup() - logger.start('shell') - setup_locale() client = GConf.Client.get_default() |