Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sugar/activity/activityfactory.py8
-rw-r--r--sugar/logger.py3
2 files changed, 4 insertions, 7 deletions
diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py
index d5bdaf7..c1cefb5 100644
--- a/sugar/activity/activityfactory.py
+++ b/sugar/activity/activityfactory.py
@@ -18,7 +18,6 @@
import logging
import subprocess
-import time
import dbus
import gobject
@@ -101,9 +100,10 @@ def get_command(activity, activity_id=None, object_id=None, uri=None):
return command
def open_log_file(activity, activity_id):
- timestamp = str(int(time.time()))
- name = '%s-%s.log' % (activity.bundle_id, timestamp)
- return open(env.get_logs_path(name), 'w')
+ for i in range(1, 100):
+ path = env.get_logs_path('%s-%s.log' % (activity.bundle_id, i))
+ if not os.path.exists(path):
+ return open(path, 'w')
class ActivityCreationHandler(gobject.GObject):
"""Sugar-side activity creation interface
diff --git a/sugar/logger.py b/sugar/logger.py
index 26b03ac..d1c9080 100644
--- a/sugar/logger.py
+++ b/sugar/logger.py
@@ -48,8 +48,5 @@ def start(log_filename=None):
log_path = os.path.join(get_logs_dir(), log_filename + '.log')
log_file = open(log_path, 'w')
- handler = logging.StreamHandler()
- logging.getLogger('').addHandler(handler)
-
os.dup2(log_file.fileno(), sys.stdout.fileno())
os.dup2(log_file.fileno(), sys.stderr.fileno())