Audacity  2.2.0
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  virtual ~AudacityLogger();
32 
33  void Show(bool show = true);
34  void Destroy();
35 
36 #if defined(EXPERIMENTAL_CRASH_REPORT)
37  wxString GetLog();
38 #endif
39 
40  protected:
41  void Flush() override;
42  void DoLogText(const wxString & msg) override;
43 
44  private:
45  void OnCloseWindow(wxCloseEvent & e);
46  void OnClose(wxCommandEvent & e);
47  void OnClear(wxCommandEvent & e);
48  void OnSave(wxCommandEvent & e);
49 
51  wxTextCtrl *mText;
52  wxString mBuffer;
53  bool mUpdated;
54 };
55 
56 #endif
AudacityLogger()
Definition: AudacityLogger.cpp:51
void Show(bool show=true)
Definition: AudacityLogger.cpp:141
void OnCloseWindow(wxCloseEvent &e)
Definition: AudacityLogger.cpp:268
void Flush() override
Definition: AudacityLogger.cpp:64
Destroy_ptr< wxFrame > mFrame
Definition: AudacityLogger.h:50
AudacityLogger is a thread-safe logger class.
Definition: AudacityLogger.h:28
wxString mBuffer
Definition: AudacityLogger.h:52
void Destroy()
Definition: AudacityLogger.cpp:97
void OnSave(wxCommandEvent &e)
Definition: AudacityLogger.cpp:292
wxTextCtrl * mText
Definition: AudacityLogger.h:51
void OnClear(wxCommandEvent &e)
Definition: AudacityLogger.cpp:286
void OnClose(wxCommandEvent &e)
Definition: AudacityLogger.cpp:280
virtual ~AudacityLogger()
Definition: AudacityLogger.cpp:59
void DoLogText(const wxString &msg) override
Definition: AudacityLogger.cpp:72
std::unique_ptr< T, Destroyer< T >> Destroy_ptr
Definition: MemoryX.h:784
bool mUpdated
Definition: AudacityLogger.h:53