77
88import * as Sentry from '@sentry/node' ;
99import { version } from '../version.js' ;
10+ import {
11+ getXcodeInfo ,
12+ getEnvironmentVariables ,
13+ checkBinaryAvailability ,
14+ } from '../tools/diagnostic.js' ;
1015
1116Sentry . init ( {
1217 dsn : 'https://798607831167c7b9fe2f2912f5d3c665@o4509258288332800.ingest.de.sentry.io/4509258293837904' ,
@@ -27,8 +32,29 @@ Sentry.init({
2732} ) ;
2833
2934// Add additional context that might be helpful for debugging
30- Sentry . setTags ( {
35+ const tags : Record < string , string > = {
3136 nodeVersion : process . version ,
3237 platform : process . platform ,
3338 arch : process . arch ,
34- } ) ;
39+ } ;
40+
41+ // Only add Xcode Info if it's available
42+ const xcodeInfo = getXcodeInfo ( ) ;
43+ if ( 'version' in xcodeInfo ) {
44+ tags . xcodeVersion = xcodeInfo . version ;
45+ tags . xcrunVersion = xcodeInfo . xcrunVersion ;
46+ } else {
47+ tags . xcodeVersion = 'Unknown' ;
48+ tags . xcrunVersion = 'Unknown' ;
49+ }
50+
51+ const envVars = getEnvironmentVariables ( ) ;
52+ tags . env_XCODEBUILDMCP_DEBUG = envVars . XCODEBUILDMCP_DEBUG || 'false' ;
53+ tags . env_XCODEMAKE_ENABLED = envVars . XCODEMAKE_ENABLED || 'false' ;
54+ tags . env_XCODEBUILDMCP_RUNNING_UNDER_MISE = envVars . XCODEBUILDMCP_RUNNING_UNDER_MISE || 'false' ;
55+
56+ const miseAvailable = checkBinaryAvailability ( 'mise' ) ;
57+ tags . miseAvailable = miseAvailable . available ? 'true' : 'false' ;
58+ tags . miseVersion = miseAvailable . version || 'Unknown' ;
59+
60+ Sentry . setTags ( tags ) ;
0 commit comments