gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog gui/Player.cpp libbase/log.cpp ...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog gui/Player.cpp libbase/log.cpp ...
Date: Mon, 17 Mar 2008 09:36:18 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/03/17 09:36:17

Modified files:
        .              : ChangeLog 
        gui            : Player.cpp 
        libbase        : log.cpp log.h 
        utilities      : processor.cpp 

Log message:
        Decouple LogFile and RcInitFile.
        Add a LogFile::setLogFilename to specify a custom name for the log file.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5942&r2=1.5943
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.91&r2=1.92
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/log.cpp?cvsroot=gnash&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/log.h?cvsroot=gnash&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.89&r2=1.90

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5942
retrieving revision 1.5943
diff -u -b -r1.5942 -r1.5943
--- ChangeLog   17 Mar 2008 09:10:55 -0000      1.5942
+++ ChangeLog   17 Mar 2008 09:36:16 -0000      1.5943
@@ -1,3 +1,13 @@
+2008-03-17 Sandro Santilli <address@hidden>
+
+       * libbase/log.{cpp,h}: decouple LogFile and RcInitFile.
+         Add a LogFile::setLogFilename to specify a custom name
+         for the log file.
+       * gui/Player.cpp: set LogFile filename as specified in the
+         rc file.
+       * utilities/processor.cpp: set LogFile filename as specified
+         in the rc file.
+
 2008-03-17 Benjamin Wolsey <address@hidden>
 
        * server/asobj/string.cpp: String.substr(): an undefined second

Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -b -r1.91 -r1.92
--- gui/Player.cpp      16 Mar 2008 14:22:50 -0000      1.91
+++ gui/Player.cpp      17 Mar 2008 09:36:17 -0000      1.92
@@ -127,6 +127,8 @@
         dbglogfile.setWriteDisk(true);
     }
     
+    dbglogfile.setLogFilename(rcfile.getDebugLog());
+
     if (rcfile.verbosityLevel() > 0) {
         dbglogfile.setVerbosity(rcfile.verbosityLevel());
     }

Index: libbase/log.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/log.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- libbase/log.cpp     5 Mar 2008 18:20:50 -0000       1.67
+++ libbase/log.cpp     17 Mar 2008 09:36:17 -0000      1.68
@@ -372,6 +372,20 @@
 
 }
 
+void
+LogFile::setLogFilename(const std::string& fname)
+{
+       closeLog();
+       _logFilename = fname;
+}
+
+void
+LogFile::setWriteDisk(bool use)
+{
+       if ( ! use ) closeLog();
+       _write = use;
+}
+
 // Default constructor
 LogFile::LogFile ()
        :
@@ -382,8 +396,6 @@
        _stamp(true),
        _write(false)
 {
-    RcInitFile& rcfile = RcInitFile::getDefaultInstance();
-    _write = rcfile.useWriteLog();
 }
 
 LogFile::~LogFile()
@@ -397,14 +409,11 @@
     if (_state != CLOSED) return true;
     if (!_write) return false;
 
-    RcInitFile& rcfile = RcInitFile::getDefaultInstance();
-
-    std::string loadfile = rcfile.getDebugLog();
-    if ( loadfile.empty() ) loadfile = DEFAULT_LOGFILE;
+    if ( _logFilename.empty() ) _logFilename = DEFAULT_LOGFILE;
 
     // TODO: expand ~ to getenv("HOME") !!
 
-    return openLog(loadfile);
+    return openLog(_logFilename);
 }
 
 bool

Index: libbase/log.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/log.h,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- libbase/log.h       5 Mar 2008 11:54:33 -0000       1.69
+++ libbase/log.h       17 Mar 2008 09:36:17 -0000      1.70
@@ -115,6 +115,14 @@
     ///
     bool closeLog();
 
+    /// Set log filename 
+    //
+    /// If a log file is opened already, it will be closed
+    /// by this call, and will be reopened on next use
+    /// if needed.
+    ///
+    void setLogFilename(const std::string& fname);
+
     // accessors for the verbose level
     void setVerbosity () {
         _verbose++;
@@ -152,9 +160,8 @@
         return _stamp;
     }
 
-    void setWriteDisk (bool b) {
-        _write = b;
-    }
+    /// Set whether to write logs to file
+    void setWriteDisk (bool b);
 
     bool getWriteDisk () {
         return _write;
@@ -230,6 +237,8 @@
            return *this << ss.str();
     }
 
+    std::string _logFilename;
+
 };
 
 

Index: utilities/processor.cpp
===================================================================
RCS file: /sources/gnash/gnash/utilities/processor.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- utilities/processor.cpp     10 Mar 2008 17:34:50 -0000      1.89
+++ utilities/processor.cpp     17 Mar 2008 09:36:17 -0000      1.90
@@ -166,13 +166,19 @@
  
     std::vector<const char*> infiles;
  
-    RcInitFile& rcfile = RcInitFile::getDefaultInstance();
+    //RcInitFile& rcfile = RcInitFile::getDefaultInstance();
     rcfile.loadFiles();
     
     if (rcfile.verbosityLevel() > 0) {
         dbglogfile.setVerbosity(rcfile.verbosityLevel());
     }
     
+    dbglogfile.setLogFilename(rcfile.getDebugLog());
+
+    if (rcfile.useWriteLog()) {
+        dbglogfile.setWriteDisk(true);
+    }
+    
     if (rcfile.useActionDump()) {
         dbglogfile.setActionDump(true);
         dbglogfile.setVerbosity();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]