Audacity  2.2.2
AudacityLogger.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  AudacityLogger.h
6 
7  Dominic Mazzoni
8 
9  This is the main source file for Audacity which handles
10  initialization and termination by subclassing wxApp.
11 
12 **********************************************************************/
13 
14 #ifndef __AUDACITY_LOGGER__
15 #define __AUDACITY_LOGGER__
16 
17 #include "Audacity.h"
18 
19 #include "MemoryX.h"
20 #include <wx/event.h>
21 #include <wx/log.h>
22 #include <wx/frame.h>
23 #include <wx/textctrl.h>
24 #include <wx/string.h>
25 
26 #include "Experimental.h"
27 
28 class AudacityLogger final : public wxEvtHandler, public wxLog {
29  public:
31 
32  void Show(bool show = true);
33 
34 #if defined(EXPERIMENTAL_CRASH_REPORT)
35  wxString GetLog();
36 #endif
37 
38  protected:
39  void Flush() override;
40  void DoLogText(const wxString & msg) override;
41 
42  private:
43  void OnCloseWindow(wxCloseEvent & e);
44  void OnClose(wxCommandEvent & e);
45  void OnClear(wxCommandEvent & e);
46  void OnSave(wxCommandEvent & e);
47 
49  wxTextCtrl *mText;
50  wxString mBuffer;
51  bool mUpdated;
52 };
53 
54 #endif
void Show(bool show=true)
void OnCloseWindow(wxCloseEvent &e)
void Flush() override
Destroy_ptr< wxFrame > mFrame
AudacityLogger is a thread-safe logger class.
wxString mBuffer
void OnSave(wxCommandEvent &e)
wxTextCtrl * mText
void OnClear(wxCommandEvent &e)
void OnClose(wxCommandEvent &e)
void DoLogText(const wxString &msg) override
std::unique_ptr< T, Destroyer< T >> Destroy_ptr
Definition: MemoryX.h:433