File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using UnityEngine ;
23
34public static class ArgumentReader
45{
56 public static string GetCommandLineArg ( string name )
67 {
78 var args = Environment . GetCommandLineArgs ( ) ;
9+ Debug . Log ( $ "Received { args . Length } arguments.") ;
10+ for ( var i = 0 ; i < args . Length ; i ++ )
11+ {
12+ if ( args [ i ] . StartsWith ( "-" ) )
13+ {
14+ Debug . Log ( $ " { args [ i ] } ") ;
15+ }
16+ }
17+
818 for ( var i = 0 ; i < args . Length ; i ++ )
919 {
1020 if ( args [ i ] == "-" + name && args . Length > i + 1 )
Original file line number Diff line number Diff line change 1- using System ;
21using Sentry . Unity ;
2+ using UnityEngine ;
33
44public class SentryCliConfiguration : SentryCliOptionsConfiguration
55{
66 public override void Configure ( SentryCliOptions cliOptions )
77 {
8+ Debug . Log ( "Calling into the 'Configure' callback for CLI options." ) ;
9+
810 if ( cliOptions . Auth is not null )
911 {
12+ Debug . Log ( "The 'AUTH TOKEN' is already set." ) ;
1013 return ;
1114 }
1215
16+ Debug . Log ( "Getting the 'AUTH TOKEN' from the commandline arguments." ) ;
1317 var token = ArgumentReader . GetCommandLineArg ( "auth_token" ) ;
1418 if ( ! string . IsNullOrEmpty ( token ) )
1519 {
20+ Debug . Log ( "Setting the 'AUTH TOKEN'." ) ;
1621 cliOptions . Auth = token ;
1722 }
1823 else
1924 {
20- throw new InvalidOperationException ( "Failed to fetch `auth_token` from the command line arguments " ) ;
25+ Debug . LogError ( "Failed to get the 'AUTH TOKEN'. " ) ;
2126 }
2227
2328 cliOptions . Organization = "demo" ;
Original file line number Diff line number Diff line change 1- using System ;
21using Sentry . Unity ;
2+ using UnityEngine ;
33
44public class SentryOptionConfiguration : SentryOptionsConfiguration
55{
66 public override void Configure ( SentryUnityOptions options )
77 {
8+ Debug . Log ( "Calling into the 'Configure' callback." ) ;
9+
810 if ( options . Dsn is not null )
911 {
12+ Debug . Log ( "The 'DSN' is already set." ) ;
1013 return ;
1114 }
1215
16+ Debug . Log ( "Getting the 'DSN' from the commandline arguments." ) ;
1317 var dsn = ArgumentReader . GetCommandLineArg ( "dsn" ) ;
1418 if ( ! string . IsNullOrEmpty ( dsn ) )
1519 {
20+ Debug . Log ( "Setting the 'DSN'." ) ;
1621 options . Dsn = dsn ;
1722 }
1823 else
1924 {
20- throw new InvalidOperationException ( "Failed to fetch `dsn` from the command line arguments " ) ;
25+ Debug . LogError ( "Failed to get the 'DSN'. " ) ;
2126 }
2227 }
2328}
You can’t perform that action at this time.
0 commit comments