@@ -75,11 +75,11 @@ def log_analyzer():
75
75
Analyze .build_script_log and provide a summary of the time execution.
76
76
"""
77
77
build_script_log_path = log_time_path ()
78
- print ("--- Build Script Analyzer ---" )
78
+ print ("--- Build Script Analyzer ---" , file = sys . stderr )
79
79
build_events = []
80
80
total_duration = 0
81
81
if os .path .exists (build_script_log_path ):
82
- print ("Build Script Log: {}" .format (build_script_log_path ))
82
+ print ("Build Script Log: {}" .format (build_script_log_path ), file = sys . stderr )
83
83
with open (build_script_log_path ) as f :
84
84
for event in f :
85
85
build_event = json .loads (event )
@@ -89,16 +89,16 @@ def log_analyzer():
89
89
finish_events = [x for x in build_events if x ["event" ] == "end" ]
90
90
finish_events .sort (key = lambda x : x ["duration" ], reverse = True )
91
91
92
- print ("Build Percentage \t Build Duration (sec) \t Build Phase" )
93
- print ("================ \t ==================== \t ===========" )
92
+ print ("Build Percentage \t Build Duration (sec) \t Build Phase" , file = sys . stderr )
93
+ print ("================ \t ==================== \t ===========" , file = sys . stderr )
94
94
event_row = '{:<17.1%} \t {:<21} \t {}'
95
95
for build_event in finish_events :
96
96
duration_percentage = \
97
97
(float (build_event ["duration" ]) / float (total_duration ))
98
98
print (event_row .format (duration_percentage ,
99
99
build_event ["duration" ],
100
- build_event ["command" ]))
101
- print ("Total Duration: {}" .format (total_duration ))
100
+ build_event ["command" ]), file = sys . stderr )
101
+ print ("Total Duration: {}" .format (total_duration ), file = sys . stderr )
102
102
else :
103
- print ("Skip build script analyzer" )
104
- print (".build_script_log file not found at {}" .format (build_script_log_path ))
103
+ print ("Skip build script analyzer" , file = sys . stderr )
104
+ print (".build_script_log file not found at {}" .format (build_script_log_path ), file = sys . stderr )
0 commit comments