Skip to content

Commit b2ac4c9

Browse files
author
José Valim
committed
Only shut down Logger if the application is being actually started
Signed-off-by: José Valim <[email protected]>
1 parent 50ac792 commit b2ac4c9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/mix/lib/mix/tasks/app.start.ex

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ defmodule Mix.Tasks.App.Start do
2626
Mix.Task.run "compile", ["--no-readd"|args]
2727
end
2828

29-
# Stop the Logger after we have used it for compilation.
30-
# It is up to the application to decide if it should be
31-
# restarted or not.
32-
# Mix should not depend directly on Logger so check that
33-
# it's loaded.
34-
if Code.ensure_loaded?(Logger), do: Logger.App.stop()
35-
3629
unless "--no-start" in args do
30+
# Stop the Logger when starting the application as it is
31+
# up to the application to decide if it should be restarted
32+
# or not.
33+
#
34+
# Mix should not depend directly on Logger so check that it's loaded.
35+
if Code.ensure_loaded?(Logger), do: Logger.App.stop()
3736
start(Mix.Project.config[:app])
3837
end
3938

0 commit comments

Comments
 (0)