[LNT] r249103 - By default, log to local directory

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 17:02:24 PDT 2015


Author: cmatthews
Date: Thu Oct  1 19:02:24 2015
New Revision: 249103

URL: http://llvm.org/viewvc/llvm-project?rev=249103&view=rev
Log:
By default, log to local directory

Modified:
    lnt/trunk/lnt/server/ui/app.py

Modified: lnt/trunk/lnt/server/ui/app.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/app.py?rev=249103&r1=249102&r2=249103&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/app.py (original)
+++ lnt/trunk/lnt/server/ui/app.py Thu Oct  1 19:02:24 2015
@@ -153,7 +153,7 @@ class App(flask.Flask):
 
         """
         if not self.debug:
-            LOG_FILENAME = "/var/log/lnt/lnt.log"
+            LOG_FILENAME = "lnt.log"
             try:
                 rotating = logging.handlers.RotatingFileHandler(
                     LOG_FILENAME, maxBytes=1048576, backupCount=5)
@@ -164,10 +164,12 @@ class App(flask.Flask):
                 rotating.setLevel(logging.DEBUG)
                 self.logger.addHandler(rotating)
             except (OSError, IOError) as e:
-                print >> sys.stderr, "Error making log file " + LOG_FILENAME + str(e)
+                print >> sys.stderr, "Error making log file", LOG_FILENAME, str(e)
                 print >> sys.stderr, "Will not log to file."
-            self.logger.info("Started file logging.")
-
+            else:
+                self.logger.info("Started file logging.")
+                print "Logging to :", LOG_FILENAME
+            
 
 def create_jinja_environment(env=None):
     """




More information about the llvm-commits mailing list