gnash-commit
[Top][All Lists]
Advanced

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

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


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog libbase/log.cpp libbase/log.h
Date: Tue, 27 May 2008 09:55:27 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/05/27 09:55:27

Modified files:
        .              : ChangeLog 
        libbase        : log.cpp log.h 

Log message:
                * libbase/log.{cpp,h}: header cleanup, rename DEBUGLEVEL to
                  GNASH_DEBUG_LEVEL to avoid conflict with OS X system headers.
                  Should fix bug #23369. Drop unused defines. Use C functions
                  in the std namespace.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6719&r2=1.6720
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/log.cpp?cvsroot=gnash&r1=1.76&r2=1.77
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/log.h?cvsroot=gnash&r1=1.77&r2=1.78

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6719
retrieving revision 1.6720
diff -u -b -r1.6719 -r1.6720
--- ChangeLog   27 May 2008 07:56:18 -0000      1.6719
+++ ChangeLog   27 May 2008 09:55:25 -0000      1.6720
@@ -1,5 +1,12 @@
 2008-05-27 Benjamin Wolsey <address@hidden>
 
+       * libbase/log.{cpp,h}: header cleanup, rename DEBUGLEVEL to
+         GNASH_DEBUG_LEVEL to avoid conflict with OS X system headers.
+         Should fix bug #23369. Drop unused defines. Use C functions
+         in the std namespace.
+
+2008-05-27 Benjamin Wolsey <address@hidden>
+
        * libbase/jpeg.cpp, libbase/rc.cpp, libbase/zlib_adapter.cpp:
          header cleanup - include sstream where it's used (It'll be
          dropped from log.h shortly). Drop c_str() for logging, use

Index: libbase/log.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/log.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -b -r1.76 -r1.77
--- libbase/log.cpp     7 May 2008 10:38:07 -0000       1.76
+++ libbase/log.cpp     27 May 2008 09:55:26 -0000      1.77
@@ -21,10 +21,12 @@
 #include "gnashconfig.h"
 #endif
 
-#include <ctime>
-#include <cctype> // for isprint
+#include <ctime> // std::strftime, std::time etc
+#include <cctype> // for std::isprint
+#include <cstring> // std::memset
 
-#include <iosfwd> // ostream, fstream, sstream
+#include <sstream>
+#include <fstream>
 #include <iomanip> // for std::setfill
 #include <string>
 #include <boost/format.hpp>
@@ -77,14 +79,15 @@
 }
 
 std::string
-timestamp() {
+timestamp()
+{
 
        time_t t;
        char buf[10];
 
-       memset (buf, '0', 10);          // this terminates the string
-       time (&t);                                      // get the current time
-       strftime (buf, sizeof(buf), "%H:%M:%S", localtime (&t));
+       std::memset (buf, '0', 10); // this terminates the string
+       std::time (&t); // get the current time
+       std::strftime (buf, sizeof(buf), "%H:%M:%S", std::localtime (&t));
 
        std::stringstream ss;
        ss << getpid() << ":" << get_thread_id() << "] " << buf;
@@ -121,7 +124,7 @@
 void
 processLog_debug(const boost::format& fmt)
 {
-       if (dbglogfile.getVerbosity() < DEBUGLEVEL) return;
+       if (dbglogfile.getVerbosity() < GNASH_DEBUG_LEVEL) return;
        dbglogfile.log(N_("DEBUG"), fmt.str());
 }
 

Index: libbase/log.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/log.h,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- libbase/log.h       21 Apr 2008 11:27:46 -0000      1.77
+++ libbase/log.h       27 May 2008 09:55:27 -0000      1.78
@@ -22,23 +22,16 @@
 #include "gnashconfig.h"
 #endif
 
-#ifdef HAVE_WINSOCK2_H
-# include <io.h>
-#endif
-
 #include "rc.h" // for IF_VERBOSE_* implementation
 #include "dsodefs.h" // for DSOEXPORT
 
 #include <fstream>
-#include <sstream>
 #include <boost/thread/thread.hpp>
 #include <boost/thread/mutex.hpp>
 #include <boost/format.hpp>
 
 // the default name for the debug log
 #define DEFAULT_LOGFILE "gnash-dbg.log"
-#define TIMESTAMP_LENGTH 24             // timestamp length
-#define TIMESTAMP_FORMAT "%Y-%m-%d %H:%M:%S     " // timestamp format
 
 // Support compilation with (or without) native language support
 #include "gettext.h"
@@ -59,7 +52,7 @@
 
 namespace gnash {
 
-#define DEBUGLEVEL 2
+#define GNASH_DEBUG_LEVEL 2
 
 // This is a basic file logging class
 class DSOEXPORT LogFile {
@@ -380,7 +373,7 @@
     }
 
     ~__Host_Function_Report__(void) {
-       if (LogFile::getDefaultInstance().getVerbosity() >= DEBUGLEVEL + 1) {
+       if (LogFile::getDefaultInstance().getVerbosity() >= GNASH_DEBUG_LEVEL + 
1) {
            log_debug("returning");
        }
     }




reply via email to

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