File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,14 @@ defmodule Mix.CLI do
8
8
Mix . start ( )
9
9
10
10
if env_variable_activated? ( "MIX_QUIET" ) , do: Mix . shell ( Mix.Shell.Quiet )
11
- if env_variable_activated? ( "MIX_DEBUG" ) , do: Mix . debug ( true )
11
+
12
+ debug? =
13
+ if env_variable_activated? ( "MIX_DEBUG" ) do
14
+ Mix . debug ( true )
15
+ true
16
+ else
17
+ false
18
+ end
12
19
13
20
if profile = System . get_env ( "MIX_PROFILE" ) do
14
21
Mix.State . put ( :profile , String . split ( profile , "," ) )
@@ -22,6 +29,13 @@ defmodule Mix.CLI do
22
29
:version ->
23
30
display_version ( )
24
31
32
+ nil when debug? ->
33
+ shell = Mix . shell ( )
34
+ shell . info ( "-> Running mix CLI" )
35
+ { time , res } = :timer . tc ( & proceed / 1 , [ args ] )
36
+ shell . info ( [ "<- Ran mix CLI in " , Integer . to_string ( div ( time , 1000 ) ) , "ms" ] )
37
+ res
38
+
25
39
nil ->
26
40
proceed ( args )
27
41
end
Original file line number Diff line number Diff line change @@ -523,7 +523,7 @@ defmodule Mix.Task do
523
523
task in Mix.State . get ( :profile , [ ] ) ->
524
524
shell = Mix . shell ( )
525
525
shell . info ( [ "-> Profiling mix " , task_to_string ( task , args ) , project_to_string ( proj ) ] )
526
- Mix.Tasks.Profile.Eprof . profile ( fun , warmup: false , set_on_spawn: false )
526
+ Mix.Tasks.Profile.Tprof . profile ( fun , warmup: false , set_on_spawn: false )
527
527
528
528
true ->
529
529
fun . ( )
You can’t perform that action at this time.
0 commit comments