Browse Source

emergency_error() now tries to use sys.stderr if no logfile.

Ask Solem 16 years ago
parent
commit
6731699c93
1 changed files with 3 additions and 0 deletions
  1. 3 0
      celery/log.py

+ 3 - 0
celery/log.py

@@ -1,5 +1,6 @@
 import multiprocessing
 import os
+import sys
 import time
 import logging
 from celery.conf import LOG_FORMAT, DAEMON_LOG_LEVEL
@@ -32,6 +33,8 @@ def emergency_error(logfile, message):
     descriptors open because the process has been daemonized or for
     some other reason."""
     logfh_needs_to_close = False
+    if not logfile:
+        logfile = sys.stderr
     if hasattr(logfile, "write"):
         logfh = logfile
     else: