Skip to content

Commit aeefd59

Browse files
author
José Valim
committed
Add Logger
1 parent 6db5091 commit aeefd59

File tree

19 files changed

+1911
-16
lines changed

19 files changed

+1911
-16
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ erlang:
6868
# Since Mix depends on EEx and EEx depends on
6969
# Mix, we first compile EEx without the .app
7070
# file, then mix and then compile EEx fully
71-
elixir: stdlib lib/eex/ebin/Elixir.EEx.beam mix ex_unit eex iex
71+
elixir: stdlib lib/eex/ebin/Elixir.EEx.beam mix ex_unit logger eex iex
7272

7373
stdlib: $(KERNEL) VERSION
7474
$(KERNEL): lib/elixir/lib/*.ex lib/elixir/lib/*/*.ex lib/elixir/lib/*/*/*.ex
@@ -90,6 +90,7 @@ $(UNICODE): lib/elixir/unicode/*
9090
$(Q) cd lib/elixir && ../../$(ELIXIRC) unicode/unicode.ex -o ebin;
9191

9292
$(eval $(call APP_TEMPLATE,ex_unit,ExUnit))
93+
$(eval $(call APP_TEMPLATE,logger,Logger))
9394
$(eval $(call APP_TEMPLATE,eex,EEx))
9495
$(eval $(call APP_TEMPLATE,mix,Mix))
9596
$(eval $(call APP_TEMPLATE,iex,IEx))
@@ -133,6 +134,7 @@ docs: compile ../ex_doc/bin/ex_doc
133134
$(call DOCS,Mix,mix,Mix)
134135
$(call DOCS,IEx,iex,IEx)
135136
$(call DOCS,ExUnit,ex_unit,ExUnit)
137+
$(call DOCS,ExUnit,logger,Logger)
136138

137139
../ex_doc/bin/ex_doc:
138140
@ echo "ex_doc is not found in ../ex_doc as expected. See README for more information."
@@ -164,7 +166,7 @@ $(TEST_EBIN)/%.beam: $(TEST_ERL)/%.erl
164166
$(Q) mkdir -p $(TEST_EBIN)
165167
$(Q) $(ERLC) -o $(TEST_EBIN) $<
166168

167-
test_elixir: test_stdlib test_ex_unit test_doc_test test_mix test_eex test_iex
169+
test_elixir: test_stdlib test_ex_unit test_logger test_doc_test test_mix test_eex test_iex
168170

169171
test_doc_test: compile
170172
@ echo "==> doctest (exunit)"

lib/elixir/src/elixir.erl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%% private to the Elixir compiler and reserved to be used by Elixir only.
33
-module(elixir).
44
-behaviour(application).
5-
-export([main/1, start_cli/0,
5+
-export([start_cli/0,
66
string_to_quoted/4, 'string_to_quoted!'/4,
77
env_for_eval/1, env_for_eval/2, quoted_to_erl/2, quoted_to_erl/3,
88
eval/2, eval/3, eval_forms/3, eval_forms/4, eval_quoted/3]).
@@ -50,16 +50,16 @@ stop(_S) ->
5050
config_change(_Changed, _New, _Remove) ->
5151
ok.
5252

53-
%% escript entry point
54-
55-
main(Args) ->
56-
{ok, _} = application:ensure_all_started(?MODULE),
57-
'Elixir.Kernel.CLI':main(Args).
58-
5953
%% Boot and process given options. Invoked by Elixir's script.
6054

6155
start_cli() ->
6256
{ok, _} = application:ensure_all_started(?MODULE),
57+
%% We start the Logger so tools that depend on Elixir
58+
%% always have the Logger directly accessible. However
59+
%% Logger is not a dependency of the Elixir application,
60+
%% which means releases that want to use Logger must
61+
%% always list it as part of its applications.
62+
_ = application:start(logger),
6363
'Elixir.Kernel.CLI':main(init:get_plain_arguments()).
6464

6565
%% EVAL HOOKS

0 commit comments

Comments
 (0)