Audacity 3.2.0
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
audacity::sentry::Report Class Referencefinal

A report to Sentry. More...

#include <SentryReport.h>

Collaboration diagram for audacity::sentry::Report:
[legend]

Classes

class  ReportImpl
 

Public Types

using CompletionHandler = std::function< void(int httpCode, std::string responseBody)>
 A callback, that will be called when Send completes. More...
 

Public Member Functions

 Report (const Exception &exception)
 Create a report from the exception and previously added exception context. More...
 
 Report (const Message &message)
 Create a report with a single log message. More...
 
 ~Report ()
 
void AddUserComment (const std::string &comment)
 Adds a user comment to the exception report. More...
 
std::string GetReportPreview () const
 Get a pretty printed report preview. More...
 
void Send (CompletionHandler completionHandler) const
 Send the report to Sentry. More...
 

Private Attributes

std::unique_ptr< ReportImplmImpl
 

Detailed Description

A report to Sentry.

Definition at line 65 of file SentryReport.h.

Member Typedef Documentation

◆ CompletionHandler

using audacity::sentry::Report::CompletionHandler = std::function<void (int httpCode, std::string responseBody)>

A callback, that will be called when Send completes.

Definition at line 69 of file SentryReport.h.

Constructor & Destructor Documentation

◆ Report() [1/2]

audacity::sentry::Report::Report ( const Exception exception)
explicit

Create a report from the exception and previously added exception context.

Definition at line 401 of file SentryReport.cpp.

402 : mImpl(std::make_unique<ReportImpl>(exception))
403{
404}
std::unique_ptr< ReportImpl > mImpl
Definition: SentryReport.h:89

◆ Report() [2/2]

audacity::sentry::Report::Report ( const Message message)
explicit

Create a report with a single log message.

Definition at line 406 of file SentryReport.cpp.

407 : mImpl(std::make_unique<ReportImpl>(message))
408{
409}

◆ ~Report()

audacity::sentry::Report::~Report ( )

Definition at line 397 of file SentryReport.cpp.

398{
399}

Member Function Documentation

◆ AddUserComment()

void audacity::sentry::Report::AddUserComment ( const std::string &  comment)

Adds a user comment to the exception report.

Definition at line 411 of file SentryReport.cpp.

412{
413 mImpl->AddUserComment(comment);
414}

References mImpl.

◆ GetReportPreview()

std::string audacity::sentry::Report::GetReportPreview ( ) const

Get a pretty printed report preview.

Definition at line 416 of file SentryReport.cpp.

417{
418 return mImpl->ToString(true);
419}

References mImpl.

◆ Send()

void audacity::sentry::Report::Send ( CompletionHandler  completionHandler) const

Send the report to Sentry.

Definition at line 421 of file SentryReport.cpp.

422{
423 mImpl->Send(std::move (completionHandler));
424}

References mImpl.

Member Data Documentation

◆ mImpl

std::unique_ptr<ReportImpl> audacity::sentry::Report::mImpl
private

Definition at line 91 of file SentryReport.h.

Referenced by AddUserComment(), GetReportPreview(), and Send().


The documentation for this class was generated from the following files: