wxWidgets: wxLogStderr Class Reference

| Version: 3.1.7

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxLogStderr Class Reference
Class List by Category » Logging

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.7-1.x86_64/src/wxWidgets-3.1.7/interface/wx/log.h>`

Inheritance diagram for wxLogStderr:
[legend]

## Detailed Description

This class can be used to redirect the log messages to a C file stream (not to be confused with C++ streams).

It is the default log target for the non-GUI wxWidgets applications which send all the output to `stderr`.

##

Library: wxBase
Category: Logging

See also
  wxLogStream

## Public Member Functions
| wxLogStderr (FILE *fp=NULL, const wxMBConv &conv=wxConvWhateverWorks)
| Constructs a log target which sends all the log messages to the given `FILE`.
wxLogFormatter * | SetFormatter (wxLogFormatter *formatter)
| Sets the specified formatter as the active one.
virtual void | Flush ()
| Show all pending output and clear the buffer.
void | LogRecord (wxLogLevel level, const wxString &msg, const wxLogRecordInfo &info)
| Log the given record.

## Additional Inherited Members
Static Public Member Functions inherited from wxLog
static void | AddTraceMask (const wxString &mask)
| Add the mask to the list of allowed masks for wxLogTrace().
static void | ClearTraceMasks ()
| Removes all trace masks previously set with AddTraceMask().
static const wxArrayString & | GetTraceMasks ()
| Returns the currently allowed list of string trace masks.
static bool | IsAllowedTraceMask (const wxString &mask)
| Returns true if the mask is one of allowed masks for wxLogTrace().
static void | RemoveTraceMask (const wxString &mask)
| Remove the mask from the list of allowed masks for wxLogTrace().
static void | DontCreateOnDemand ()
| Instructs wxLog to not create new log targets on the fly if there is none currently (see GetActiveTarget()).
static wxLog * | GetActiveTarget ()
| Returns the pointer to the active log target (may be NULL).
static wxLog * | SetActiveTarget (wxLog *logtarget)
| Sets the specified log target as the active one.
static wxLog * | SetThreadActiveTarget (wxLog *logger)
| Sets a thread-specific log target.
static void | FlushActive ()
| Flushes the current log target if any, does nothing if there is none.
static void | Resume ()
| Resumes logging previously suspended by a call to Suspend().
static void | Suspend ()
| Suspends the logging until Resume() is called.
static wxLogLevel | GetLogLevel ()
| Returns the current log level limit.
static bool | IsLevelEnabled (wxLogLevel level, wxString component)
| Returns true if logging at this level is enabled for the current thread.
static void | SetComponentLevel (const wxString &component, wxLogLevel level)
| Sets the log level for the given component.
static void | SetLogLevel (wxLogLevel logLevel)
| Specifies that log messages with level greater (numerically) than logLevel should be ignored and not sent to the active log target.
static bool | EnableLogging (bool enable=true)
| Globally enable or disable logging.
static bool | IsEnabled ()
| Returns true if logging is enabled at all now.
static bool | GetRepetitionCounting ()
| Returns whether the repetition counting mode is enabled.
static void | SetRepetitionCounting (bool repetCounting=true)
| Enables logging mode in which a log message is logged once, and in case exactly the same message successively repeats one or more times, only the number of repetitions is logged.
static const wxString & | GetTimestamp ()
| Returns the current timestamp format string.
static void | SetTimestamp (const wxString &format)
| Sets the timestamp format prepended by the default log targets to all messages.
static void | DisableTimestamp ()
| Disables time stamping of the log messages.
static bool | GetVerbose ()
| Returns whether the verbose mode is currently active.
static void | SetVerbose (bool verbose=true)
| Activates or deactivates verbose mode in which the verbose messages are logged as the normal ones instead of being silently dropped.
Protected Member Functions inherited from wxLog
virtual void | DoLogRecord (wxLogLevel level, const wxString &msg, const wxLogRecordInfo &info)
| Called to log a new record.
virtual void | DoLogTextAtLevel (wxLogLevel level, const wxString &msg)
| Called to log the specified string at given level.
virtual void | DoLogText (const wxString &msg)
| Called to log the specified string.

## Constructor & Destructor Documentation

## ◆ wxLogStderr()

wxLogStderr::wxLogStderr | ( | FILE * | fp = NULL,
|  | const wxMBConv & | conv = wxConvWhateverWorks )

Constructs a log target which sends all the log messages to the given `FILE`.

If it is NULL, the messages are sent to `stderr`. The messages will be written in the encoding specified by the given `wxMBConv`.

The conv argument is only available in wxWidgets 3.1.1 and later.

Note
  In practice, it is only advisable to specify `wxConvUTF8` as the conv. If using `wxMBConvUTF16()`, the file should be opened in `"wb"` mode.

Warning
  If a log message contains any characters that cannot be converted to the character set given by conv, that message will be silently ignored, i.e. it will not be written at all.