{"action":"closed","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/5319","repository_url":"https://api.github.com/repos/elixir-lang/elixir","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5319/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5319/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5319/events","html_url":"https://github.com/elixir-lang/elixir/issues/5319","id":182776636,"number":5319,"title":"Logger.App.start/2 not uninstalling SASL logger from error_logger (possibly typo?)","user":{"login":"ymtszw","id":4507126,"avatar_url":"https://avatars.githubusercontent.com/u/4507126?v=3","gravatar_id":"","url":"https://api.github.com/users/ymtszw","html_url":"https://github.com/ymtszw","followers_url":"https://api.github.com/users/ymtszw/followers","following_url":"https://api.github.com/users/ymtszw/following{/other_user}","gists_url":"https://api.github.com/users/ymtszw/gists{/gist_id}","starred_url":"https://api.github.com/users/ymtszw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymtszw/subscriptions","organizations_url":"https://api.github.com/users/ymtszw/orgs","repos_url":"https://api.github.com/users/ymtszw/repos","events_url":"https://api.github.com/users/ymtszw/events{/privacy}","received_events_url":"https://api.github.com/users/ymtszw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/App:Logger","name":"App:Logger","color":"cccccc"},{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Kind:Bug","name":"Kind:Bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-13T12:31:56Z","updated_at":"2016-10-13T16:00:20Z","closed_at":"2016-10-13T16:00:20Z","body":"### Environment\r\n\r\n* Elixir version (elixir -v): 1.3.4\r\n* Operating system: OSX 10.10.5\r\n\r\n### Current behavior\r\n\r\nAs stated in [`Logger`'s doc](http://elixir-lang.org/docs/stable/logger/Logger.html), when `:handle_sasl_reports` set to `true`, `Logger` app should uninstall [`sasl`'s handler](http://erlang.org/doc/man/sasl_app.html) from `error_logger`.\r\n\r\nHowever it looks still installed even with `handle_sasl_reports: true`. Can be confirmed from iex:\r\n\r\n```\r\n$ iex\r\nErlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]\r\n\r\nInteractive Elixir (1.3.4) - press Ctrl+C to exit (type h() ENTER for help)\r\niex(1)> Application.started_applications\r\n[{:logger, 'logger', '1.3.4'}, {:iex, 'iex', '1.3.4'},\r\n {:elixir, 'elixir', '1.3.4'}, {:compiler, 'ERTS  CXC 138 10', '7.0.2'},\r\n {:stdlib, 'ERTS  CXC 138 10', '3.1'}, {:kernel, 'ERTS  CXC 138 10', '5.1'}]\r\n\r\niex(2)> Application.stop(:logger) # Stop initially started Logger\r\n\r\n=INFO REPORT==== 13-Oct-2016::21:12:23 ===\r\n    application: logger\r\n    exited: stopped\r\n    type: temporary\r\n:ok\r\n\r\niex(3)> :gen_event.which_handlers(:error_logger) # Check default handlers\r\n[:error_logger_tty_h, :error_logger]\r\n\r\niex(4)> Application.start(:sasl) # Start SASL\r\n\r\n(snip)\r\n\r\niex(5)> :gen_event.which_handlers(:error_logger) # Confirm SASL handler installed\r\n[:sasl_report_tty_h, :error_logger_tty_h, :error_logger]\r\n\r\niex(7)> Application.put_env(:logger, :handle_sasl_reports, true) # Set :handle_sasl_reports\r\n:ok\r\n\r\niex(8)> Application.start(:logger) # Start Logger with new config. After this, both SASL's handler and Logger start logging into stdout\r\n\r\n(snip)\r\n\r\niex(9)> :gen_event.which_handlers(:error_logger) # Check updated handlers, OTP's :error_logger_tty_h is uninstalled but SASL's isn't\r\n[Logger.ErrorHandler, :sasl_report_tty_h, :error_logger]\r\n\r\niex(10)> Application.stop(:logger) # Stop Logger again\r\n\r\n(snip)\r\n\r\niex(11)> :gen_event.which_handlers(:error_logger) # OTP's handler is installed again\r\n[:error_logger_tty_h, :sasl_report_tty_h, :error_logger]\r\n```\r\n\r\n### Expected behavior\r\n\r\nObviously, `:sasl_report_tty_h` handler above should be uninstalled.\r\n\r\nLooking into [logger/app.ex#l.29](https://github.com/elixir-lang/elixir/blob/master/lib/logger/lib/logger/app.ex#L29), I've found this:\r\n\r\n```ex\r\n        handlers = [error_logger_tty_h: otp_reports?,\r\n                    sasl_logger_tty_h: sasl_reports?]\r\n        delete_handlers(handlers)\r\n```\r\n\r\nI think this is typo?\r\n\r\n`:sasl_logger_tty_h` should be `:sasl_report_tty_h`"}}
{"actor":{"display_login":"fishcakez"}}