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: Wed, 26 Mar 2008 21:27:30 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/03/26 21:27:30

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

Log message:
                * libbase/log.{h,cpp}: drop (unused) vsnprintf logging calls, 
tidy up
                  a bit.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6033&r2=1.6034
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/log.cpp?cvsroot=gnash&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/log.h?cvsroot=gnash&r1=1.71&r2=1.72

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6033
retrieving revision 1.6034
diff -u -b -r1.6033 -r1.6034
--- ChangeLog   26 Mar 2008 20:40:31 -0000      1.6033
+++ ChangeLog   26 Mar 2008 21:27:29 -0000      1.6034
@@ -1,4 +1,9 @@
-2008-03-22  Dossy Shiobara <address@hidden>
+2008-03-26 Benjamin Wolsey <address@hidden>
+
+       * libbase/log.{h,cpp}: drop (unused) vsnprintf logging calls, tidy up
+         a bit.
+
+2008-03-26  Dossy Shiobara <address@hidden>
 
        * gui/Makefile.am, gui/am-frag/fltk.am: Add missing
          line-continuation backslash. Move extra Win32 libs to

Index: libbase/log.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/log.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- libbase/log.cpp     17 Mar 2008 09:36:17 -0000      1.68
+++ libbase/log.cpp     26 Mar 2008 21:27:30 -0000      1.69
@@ -21,12 +21,8 @@
 #include "gnashconfig.h"
 #endif
 
-#ifndef USE_BOOST_FORMAT_TEMPLATES
-# include <cstdio>  
-# include <cstdarg> // Both for vsnprintf
-#endif
-
 #include <ctime>
+#include <cctype>
 
 #include <iostream>
 #include <sstream>
@@ -39,11 +35,10 @@
 // Required for SYSTEMTIME definitions
 # include <windows.h>
 # include <sys/types.h>
-# include <unistd.h> 
-#else
-# include <unistd.h>
 #endif
 
+#include <unistd.h>
+
 #include "log.h"
 
 using std::cout;
@@ -51,9 +46,6 @@
 
 namespace gnash {
 
-// Workspace for vsnprintf formatting.
-static const int BUFFER_SIZE = 2048;
-
 // Convert each byte into its hex representation
 std::string hexify (const unsigned char *p, size_t length, bool ascii)
 {
@@ -69,7 +61,7 @@
                                i != e; ++i)
        {
                if (ascii) {
-                       if (isprint(*i) || *i == 0xd || *i == 0xa) {
+                       if (std::isprint(*i) || *i == 0xd || *i == 0xa) {
                                ss << *i;
                        }
                        else ss << "^";
@@ -142,156 +134,6 @@
        LogFile& dbglogfile = LogFile::getDefaultInstance();
 }
 
-#ifndef USE_BOOST_FORMAT_TEMPLATES
-
-void
-log_trace(const char* fmt, ...)
-{
-
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       dbglogfile.log(_("TRACE"), tmp);
-
-       va_end (ap);
-}
-
-void
-log_debug(const char* fmt, ...)
-{
-
-       if (dbglogfile.getVerbosity() < DEBUGLEVEL) return;
-
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       // We don't translate DEBUG: because code below here looks for it
-       // in the output of const char strings.  If we translated it, both
-       // its type would change (to non-const char string) and the letters 
would
-       // change to the local language.  Could perhaps be fixed more cleanly
-       // later...
-       dbglogfile.log(N_("DEBUG"), tmp);
-
-       va_end (ap);
-}
-
-void
-log_action(const char* fmt, ...)
-{
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       bool stamp = dbglogfile.getStamp();
-       dbglogfile.setStamp(false);
-       dbglogfile.log(tmp);
-       dbglogfile.setStamp(stamp);
-}
-
-void
-log_parse(const char* fmt, ...)
-{
-
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       dbglogfile.log(tmp);
-
-       va_end (ap);
-}
-
-// Printf-style error log.
-void
-log_error(const char* fmt, ...)
-{
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       dbglogfile.log(_("ERROR"), tmp);
-
-       va_end (ap);
-}
-
-void
-log_unimpl(const char* fmt, ...)
-{
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE-1, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       dbglogfile.log(_("UNIMPLEMENTED"), tmp);
-
-       va_end (ap);
-}
-
-void
-log_security(const char* fmt, ...)
-{
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE-1, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       dbglogfile.log(_("SECURITY"), tmp);
-
-       va_end (ap);
-}
-
-void
-log_swferror(const char* fmt, ...)
-{
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE-1, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       dbglogfile.log(_("MALFORMED SWF"), tmp);
-
-       va_end (ap);
-}
-
-void
-log_aserror(const char* fmt, ...)
-{
-       va_list ap;
-       char tmp[BUFFER_SIZE];
-
-       va_start (ap, fmt);
-       vsnprintf (tmp, BUFFER_SIZE-1, fmt, ap);
-       tmp[BUFFER_SIZE-1] = '\0';
-
-       dbglogfile.log(_("ACTIONSCRIPT ERROR"), tmp);
-
-       va_end (ap);
-}
-
-#else
 // boost format functions to process the objects
 // created by our hundreds of templates 
 
@@ -353,13 +195,10 @@
        dbglogfile.setStamp(stamp);
 }
 
-#endif
-
 void
 LogFile::log(const std::string& msg)
 {
        boost::mutex::scoped_lock lock(_ioMutex);
-
        dbglogfile << msg << endl;
 }
 
@@ -367,9 +206,7 @@
 LogFile::log(const std::string& label, const std::string& msg)
 {
        boost::mutex::scoped_lock lock(_ioMutex);
-
        dbglogfile << label << ": " << msg << endl;
-
 }
 
 void

Index: libbase/log.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/log.h,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- libbase/log.h       23 Mar 2008 23:57:58 -0000      1.71
+++ libbase/log.h       26 Mar 2008 21:27:30 -0000      1.72
@@ -54,24 +54,21 @@
 
 // Define to switch between printf-style log formatting
 // and boost::format
-#define USE_BOOST_FORMAT_TEMPLATES 1
-
-#ifdef USE_BOOST_FORMAT_TEMPLATES
 # include <boost/preprocessor/arithmetic/inc.hpp>
 # include <boost/preprocessor/repetition/enum_params.hpp>
 # include <boost/preprocessor/repetition/repeat.hpp>
 # include <boost/preprocessor/repetition/repeat_from_to.hpp>
 # include <boost/preprocessor/seq/for_each.hpp>
-#endif
 
 namespace gnash {
 
-extern std::ostream& stampon(std::ostream& x);
-extern std::ostream& stampoff(std::ostream& x);
-extern std::ostream& timestamp(std::ostream& x);
-extern std::ostream& datetimestamp(std::ostream& x);
 #define DEBUGLEVEL 2
 
+//extern std::ostream& stampon(std::ostream& x);
+//extern std::ostream& stampoff(std::ostream& x);
+//extern std::ostream& timestamp(std::ostream& x);
+//extern std::ostream& datetimestamp(std::ostream& x);
+
 // This is a basic file logging class
 class DSOEXPORT LogFile {
 public:
@@ -242,8 +239,6 @@
 
 };
 
-
-#ifdef USE_BOOST_FORMAT_TEMPLATES
 /// This heap of steaming preprocessor code magically converts
 /// printf-style statements into boost::format messages using templates.
 //
@@ -323,92 +318,6 @@
 DSOEXPORT void processLog_swferror(const boost::format& fmt);
 DSOEXPORT void processLog_aserror(const boost::format& fmt);
 
-#else
-
-#ifdef __GNUC__
-#define GNUC_LOG_ATTRS __attribute__((format (printf, 1, 2)))
-#else
-#define GNUC_LOG_ATTRS
-#endif
-
-/// Log a runtime error
-//
-/// Runtime errors, such as un-openable files, un-allocatable memory,
-/// etc, are logged (for convenience of the user or debugger) this way.
-/// This function is not used to report coding errors; use log_aserror
-/// or log_swferror for that.
-///
-DSOEXPORT void log_error(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-/// Log a message about unimplemented features.
-//
-/// This function must be used to warn user about missing Gnash features.
-/// We expect all calls to this function to disappear over time, as we
-/// implement those features of Flash.
-///
-DSOEXPORT void log_unimpl(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-/// Use only for explicit user traces
-//
-/// Current users are Global.cpp for _global.trace() and
-/// ASHandlers.cpp for ActionTrace
-///
-DSOEXPORT void log_trace(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-/// Log debug info
-//
-/// Used for function entry/exit tracing.
-///
-DSOEXPORT void log_debug(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-/// Log action execution info
-//
-/// Wrap all calls to this function (and other related statements)
-/// into an IF_VERBOSE_ACTION macro, so to allow completely
-/// removing all the overhead at compile time and reduce it
-/// at runtime.
-///
-DSOEXPORT void log_action(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-/// Log parsing information
-//
-/// Wrap all calls to this function (and other related statements)
-/// into an IF_VERBOSE_PARSE macro, so to allow completely
-/// removing all the overhead at compile time and reduce it
-/// at runtime.
-///
-DSOEXPORT void log_parse(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-/// Log security information
-DSOEXPORT void log_security(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-/// Log a malformed SWF error
-//
-/// This indicates an error in how the binary SWF file was constructed, i.e.
-/// probably a bug in the tools used to build the SWF file.
-///
-/// Wrap all calls to this function (and other related statements)
-/// into an IF_VERBOSE_MALFORMED_SWF macro, so to allow completely
-/// removing all the overhead at compile time and reduce it
-/// at runtime.
-///
-DSOEXPORT void log_swferror(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-/// Log an ActionScript error
-//
-/// This indicates an error by the programmer who wrote the ActionScript
-/// code, such as too few or too many arguments to a function.
-///
-/// Wrap all calls to this function (and other related statements)
-/// into an IF_VERBOSE_ASCODING_ERRORS macro, so to allow completely
-/// removing all the overhead at compile time and reduce it
-/// at runtime.
-///
-DSOEXPORT void log_aserror(const char* fmt, ...) GNUC_LOG_ATTRS;
-
-
-#endif // USE_BOOST_FORMAT_TEMPLATES
-
 /// A fault-tolerant boost::format object for logging
 //
 /// Generally to be used in the LogFile macro BF(), which will also




reply via email to

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