Skip to content

Commit

Permalink
improve Apple Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
irov committed Aug 24, 2023
1 parent 44248fe commit b5f438d
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,21 @@ @implementation AppleSentryApplicationDelegate

#pragma mark - UIKitProxyApplicationDelegateInterface

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSString * AppleSentryPlugin_DSN = Mengine::Helper::AppleGetBundlePluginConfigString( @("MengineAppleSentryPlugin"), @("DSN"), nil );

if( AppleSentryPlugin_DSN == nil )
{
return NO;
}

BOOL AppleSentryPlugin_Debug = Mengine::Helper::AppleGetBundlePluginConfigBoolean( @("MengineAppleSentryPlugin"), @("Debug"), NO );

const Mengine::Char * BUILD_VERSION = Mengine::Helper::getBuildVersion();

[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.dsn = AppleSentryPlugin_DSN;
options.debug = AppleSentryPlugin_Debug; // Enabled debug when first installing is always helpful
options.debug = MENGINE_DEBUG_VALUE(YES, NO); // Enabled debug when first installing is always helpful
options.environment = MENGINE_BUILD_PUBLISH_VALUE(@"production", @"debug");
options.releaseName = @(BUILD_VERSION);
options.attachStacktrace = true;
options.tracesSampleRate = @(1.0);
}];

return YES;
Expand Down
20 changes: 0 additions & 20 deletions src/Plugins/AppleSentryPlugin/AppleSentryHelper.h

This file was deleted.

50 changes: 0 additions & 50 deletions src/Plugins/AppleSentryPlugin/AppleSentryHelper.mm

This file was deleted.

5 changes: 3 additions & 2 deletions src/Plugins/AppleSentryPlugin/AppleSentryLoggerCapture.mm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include "AppleSentryLoggerCapture.h"
#include "AppleSentryHelper.h"

#include "Kernel/ConfigHelper.h"
#include "Kernel/LoggerHelper.h"

#include "Config/StdString.h"

#import <Sentry/Sentry.h>

namespace Mengine
{
//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -43,7 +44,7 @@

MENGINE_STRNCAT( buffer, data_str, data_size );

Helper::appleSentryMessageCapture( buffer );
[SentrySDK captureMessage:@(buffer)];
}
//////////////////////////////////////////////////////////////////////////
}
2 changes: 1 addition & 1 deletion src/Plugins/AppleSentryPlugin/AppleSentryPlugin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
//////////////////////////////////////////////////////////////////////////
void AppleSentryPlugin::_finalizePlugin()
{
{
SERVICE_FINALIZE( AppleSentryService );
}
//////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/AppleSentryPlugin/AppleSentryService.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Mengine

public:
bool _initializeService() override;
void _finalizeService() override;
void _finalizeService() override;

protected:
void notifyCreateApplication_();
Expand Down
Loading

0 comments on commit b5f438d

Please sign in to comment.