Opened 15 years ago

Closed 15 years ago

#162 closed defect (fixed)

Use shell.log in sugar emulator as well

Reported by: erikos Owned by: marcopg
Priority: minor Milestone:
Component: Sugar Version: Git as of bugdate
Severity: Keywords: r?
Cc: Distribution/OS:
Bug Status:

Description

I think it make sense to always use the same logging mechanism and print the logs to the file. If you like to keep the output in the shell as well - we could as well add printing to both in the emulator case.

diff --git a/src/sugar/logger.py b/src/sugar/logger.py
index 26a7fe3..e62edc6 100644
--- a/src/sugar/logger.py
+++ b/src/sugar/logger.py
@@ -91,7 +91,7 @@ def start(log_filename=None):
     if os.environ.has_key('SUGAR_LOGGER_LEVEL'):
         set_level(os.environ['SUGAR_LOGGER_LEVEL'])
 
-    if log_filename and not sys.stdin.isatty():
+    if log_filename:
         try:
             log_path = os.path.join(get_logs_dir(), log_filename + '.log')

Change History (1)

comment:1 Changed 15 years ago by erikos

  • Resolution set to fixed
  • Status changed from new to closed

Pushed this, as verbally accepted by tomeu

Note: See TracTickets for help on using tickets.