From 7b1bf3ad2d419ea08ec29a39ed4c96c33a2f12e1 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Wed, 27 Jun 2007 12:09:55 +0000
Subject: [PATCH] added wxLog::DisableTimestamp() to be used as a synonym for
 SetTimestamp(wxEmptyString)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/changes.txt          |  7 +++++--
 docs/latex/wx/log.tex     | 16 +++++++++++++---
 include/wx/log.h          |  9 ++++++---
 samples/grid/griddemo.cpp |  2 +-
 4 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/docs/changes.txt b/docs/changes.txt
index f60b16039c..3973da57d9 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -71,9 +71,12 @@ Changes in behaviour which may result in compilation errors
 
 - virtual wxHtmlParser::AddText() takes wxString, not wxChar*, argument now.
 
-- Funtions that took wxChar* arguments that could by NULL in wxWidgets 2.8.
+- Functions that took wxChar* arguments that could by NULL in wxWidgets 2.8.
   are deprecated and passing NULL to them won't compile anymore, wxEmptyString
-  must be used instead.
+  must be used instead. In some cases new functions can be used too, e.g.:
+    * use wxLog::DisableTimestamp() instead of wxLog::SetTimestamp(NULL)
+    * wxUnsetEnv(var) instead of wxSetEnv(var, NULL)
+
 
 Deprecated methods and their replacements
 -----------------------------------------
diff --git a/docs/latex/wx/log.tex b/docs/latex/wx/log.tex
index ae311235b4..7fb5832297 100644
--- a/docs/latex/wx/log.tex
+++ b/docs/latex/wx/log.tex
@@ -341,16 +341,24 @@ Returns whether the repetition counting mode is enabled.
 
 \membersection{wxLog::SetTimestamp}\label{wxlogsettimestamp}
 
-\func{void}{SetTimestamp}{\param{const wxStrgin\&}{ format}}
+\func{static void}{SetTimestamp}{\param{const wxString\&}{ format}}
 
 Sets the timestamp format prepended by the default log targets to all
 messages. The string may contain any normal characters as well as \%
 prefixed format specificators, see {\it strftime()} manual for details.
-Passing a NULL value (not empty string) to this function disables message timestamping.
+Passing an empty string to this function disables message time stamping.
+
+\membersection{wxLog::DisableTimestamp}\label{wxlogdisabletimestamp}
+
+\func{void}{SetTimestamp}{\param{const wxString\&}{ format}}
+
+Disables time stamping of the log messages.
+
+\newsince{2.9}
 
 \membersection{wxLog::GetTimestamp}\label{wxloggettimestamp}
 
-\constfunc{const wxString\&}{GetTimestamp}{\void}
+\func{static const wxString\&}{GetTimestamp}{\void}
 
 Returns the current timestamp format string.
 
@@ -363,6 +371,8 @@ section for details.
 
 \membersection{wxLog::GetTraceMask}\label{wxloggettracemask}
 
+\func{static wxTraceMask}{GetTraceMask}{\void}
+
 Returns the current trace mask, see \helpref{Customization}{wxlogcustomization} section
 for details.
 
diff --git a/include/wx/log.h b/include/wx/log.h
index de2b9b817a..9166b7ee50 100644
--- a/include/wx/log.h
+++ b/include/wx/log.h
@@ -208,11 +208,14 @@ public:
     // get string trace masks
     static const wxArrayString &GetTraceMasks() { return ms_aTraceMasks; }
 
-    // sets the timestamp string: this is used as strftime() format string
-    // for the log targets which add time stamps to the messages - set it
-    // to NULL to disable time stamping completely.
+    // sets the time stamp string format: this is used as strftime() format
+    // string for the log targets which add time stamps to the messages; set
+    // it to empty string to disable time stamping completely.
     static void SetTimestamp(const wxString& ts) { ms_timestamp = ts; }
 
+    // disable time stamping of log messages
+    static void DisableTimestamp() { SetTimestamp(wxEmptyString); }
+
 
     // accessors
 
diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp
index d6ceb21e3b..ad992afb47 100644
--- a/samples/grid/griddemo.cpp
+++ b/samples/grid/griddemo.cpp
@@ -266,7 +266,7 @@ GridFrame::GridFrame()
 
     logger = new wxLogTextCtrl( logWin );
     m_logOld = wxLog::SetActiveTarget( logger );
-    wxLog::SetTimestamp( NULL );
+    wxLog::DisableTimestamp();
 #endif // wxUSE_LOG
 
     // this will create a grid and, by default, an associated grid
-- 
2.50.0

