Skip to content

Commit

Permalink
Setup logging as soon as possible
Browse files Browse the repository at this point in the history
So that we don't lose any traceback

Acked-by: Simon Schampijer <simon@laptop.org>
  • Loading branch information
dnarvaez authored and Simon Schampijer committed Jan 22, 2013
1 parent 535460e commit 19db9c5
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/jarabe/main.py
Expand Up @@ -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
Expand All @@ -44,7 +47,6 @@
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
Expand Down Expand Up @@ -199,9 +201,6 @@ def main():

cleanup_temporary_files()

logger.cleanup()
logger.start('shell')

setup_locale()

client = GConf.Client.get_default()
Expand Down

0 comments on commit 19db9c5

Please sign in to comment.