11from pathlib import Path
2+ import sentry_sdk
23from .runner import Runner
34from .verify import ExerciseSeeker
45from .constants import exercise_files_architecture
56from .utils .starklings_directory import StarklingsDirectory , VersionManager
67from .solution import SolutionPatcher
78
89
10+ sentry_sdk .init (
11+ "https://73212d09152344fd8e351ef180b8fa75@o1254095.ingest.sentry.io/6421829" ,
12+ # Set traces_sample_rate to 1.0 to capture 100%
13+ # of transactions for performance monitoring.
14+ # We recommend adjusting this value in production.
15+ traces_sample_rate = 1.0 ,
16+ )
17+
18+
919async def cli (args , script_root : Path ):
1020 starklings_directory = StarklingsDirectory (script_root )
1121 version_manager = VersionManager (starklings_directory )
@@ -14,10 +24,12 @@ async def cli(args, script_root: Path):
1424 version_manager .print_current_version ()
1525
1626 if args .watch :
27+ sentry_sdk .capture_message ("Starting the watch mode" )
1728 runner = Runner (script_root )
1829 runner .run ()
1930
2031 if args .verify :
32+ sentry_sdk .capture_message ("Verifying all the exercises" )
2133 seeker = ExerciseSeeker (exercise_files_architecture , script_root )
2234 exercise_path = seeker .find_next_exercise ()
2335
@@ -27,6 +39,9 @@ async def cli(args, script_root: Path):
2739 print (exercise_path )
2840
2941 if args .solution :
42+ sentry_sdk .capture_message (
43+ "Displaying the solution" , path_to_solution = args .solution
44+ )
3045 displayer = SolutionPatcher (args .solution )
3146 solution = displayer .get_solution ()
3247 if solution :
0 commit comments