1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-29 06:38:38 +02:00
audacity/src/AudacityLogger.h
Leland Lucius 923827966c Add debug report (crash report) to Help menu
This captures crashes on Windows along with the stack backtrace.

On Linux (fedora 21 at least), the necessary function to enable
capture is not included in the system wx libs.  But, a self built
version works fine and capture the backtrace, so I'm assuming
other distros will probably work as well.

On OSX, the crashes are caught, but it does not include the
backtrace.

But, really, the backtraces aren't all that useful in a release
build since we don't ship with debug symbols and optimization
plays havoc with proper backtraces anyway.

The real benefit will be for the support folks as they can now
get consistent info from user by asking the to generate a report
from the "Help->Generate Support Data" menu item.
2015-04-18 05:06:28 -05:00

56 lines
1.1 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
AudacityLogger.h
Dominic Mazzoni
This is the main source file for Audacity which handles
initialization and termination by subclassing wxApp.
**********************************************************************/
#ifndef __AUDACITY_LOGGER__
#define __AUDACITY_LOGGER__
#include "Audacity.h"
#include <wx/event.h>
#include <wx/log.h>
#include <wx/frame.h>
#include <wx/textctrl.h>
#include <wx/string.h>
#include "Experimental.h"
class AudacityLogger:public wxEvtHandler, public wxLog {
public:
AudacityLogger();
virtual ~AudacityLogger();
void Show(bool show = true);
void Destroy();
#if defined(EXPERIMENTAL_CRASH_REPORT)
wxString GetLog();
#endif
protected:
virtual void Flush();
virtual void DoLogString(const wxChar *szString, time_t t);
private:
void OnCloseWindow(wxCloseEvent & e);
void OnClose(wxCommandEvent & e);
void OnClear(wxCommandEvent & e);
void OnSave(wxCommandEvent & e);
wxFrame *mFrame;
wxTextCtrl *mText;
wxString mBuffer;
bool mUpdated;
};
#endif