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
This commit is contained in:
Vadim Zeitlin
2007-06-27 12:09:55 +00:00
parent 13aaa50f48
commit 7b1bf3ad2d
4 changed files with 25 additions and 9 deletions

View File

@@ -71,9 +71,12 @@ Changes in behaviour which may result in compilation errors
- virtual wxHtmlParser::AddText() takes wxString, not wxChar*, argument now. - 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 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 Deprecated methods and their replacements
----------------------------------------- -----------------------------------------

View File

@@ -341,16 +341,24 @@ Returns whether the repetition counting mode is enabled.
\membersection{wxLog::SetTimestamp}\label{wxlogsettimestamp} \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 Sets the timestamp format prepended by the default log targets to all
messages. The string may contain any normal characters as well as \% messages. The string may contain any normal characters as well as \%
prefixed format specificators, see {\it strftime()} manual for details. 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} \membersection{wxLog::GetTimestamp}\label{wxloggettimestamp}
\constfunc{const wxString\&}{GetTimestamp}{\void} \func{static const wxString\&}{GetTimestamp}{\void}
Returns the current timestamp format string. Returns the current timestamp format string.
@@ -363,6 +371,8 @@ section for details.
\membersection{wxLog::GetTraceMask}\label{wxloggettracemask} \membersection{wxLog::GetTraceMask}\label{wxloggettracemask}
\func{static wxTraceMask}{GetTraceMask}{\void}
Returns the current trace mask, see \helpref{Customization}{wxlogcustomization} section Returns the current trace mask, see \helpref{Customization}{wxlogcustomization} section
for details. for details.

View File

@@ -208,11 +208,14 @@ public:
// get string trace masks // get string trace masks
static const wxArrayString &GetTraceMasks() { return ms_aTraceMasks; } static const wxArrayString &GetTraceMasks() { return ms_aTraceMasks; }
// sets the timestamp string: this is used as strftime() format string // sets the time stamp string format: this is used as strftime() format
// for the log targets which add time stamps to the messages - set it // string for the log targets which add time stamps to the messages; set
// to NULL to disable time stamping completely. // it to empty string to disable time stamping completely.
static void SetTimestamp(const wxString& ts) { ms_timestamp = ts; } static void SetTimestamp(const wxString& ts) { ms_timestamp = ts; }
// disable time stamping of log messages
static void DisableTimestamp() { SetTimestamp(wxEmptyString); }
// accessors // accessors

View File

@@ -266,7 +266,7 @@ GridFrame::GridFrame()
logger = new wxLogTextCtrl( logWin ); logger = new wxLogTextCtrl( logWin );
m_logOld = wxLog::SetActiveTarget( logger ); m_logOld = wxLog::SetActiveTarget( logger );
wxLog::SetTimestamp( NULL ); wxLog::DisableTimestamp();
#endif // wxUSE_LOG #endif // wxUSE_LOG
// this will create a grid and, by default, an associated grid // this will create a grid and, by default, an associated grid