Commit Graph
216 Commits
Author SHA1 Message Date
José Valim b378a2d560 Ensure translators are persisted across logger restarts 2024-05-01 11:35:01 +02:00
Cameron Duley 70391199a4 Translate :gen_statem termination reports (#13451) 2024-04-03 10:59:21 +02:00
Jean Klingler 40f5374c2b Log process label in GenServer and :gen_event crash report (#13424)
* Log process label in :gen_event crash report

* Log process label in GenServer crash report

* Simplify existing tests

* Use inspect opts when inspecting label
2024-03-20 22:22:23 +09:00
Jean Klingler 349321117e Log :$process_label in Task crash report (#13406) 2024-03-16 19:05:47 +09:00
José Valim e0ad0c020b Fix warnings in test suite 2024-03-14 22:05:20 +01:00
Jean Klingler 15586e2fb0 Logger logs :process_label if present (#13396) 2024-03-06 20:53:43 +09:00
José Valim bfd1330d16 Handle invalid :time in metadata, closes #13190 2023-12-29 16:29:36 +01:00
Zeke Douandc4710n 1ef9eaf900 Add Logger.levels/0 (#13136)
Co-authored-by: c4710n <c4710n@users.noreply.github.com>
2023-11-23 15:08:31 +01:00
José Valim 8bc67d384b Use PID valid for 32-bit systems, closes #12741 2023-07-02 10:28:58 +02:00
José Valim 7303e58d2b Handle :function metadata properly, closes #12703 2023-06-23 13:07:04 +02:00
José Valim ecdf684381 Reduce footprint of tasks
Tasks were launched with proc_lib, which added
additional processing on boot. We removed the
proc_lib layer, which has the benefit of removing
the double logging (which only happened on tasks
but not any other behaviour).
2023-05-25 09:23:16 +02:00
José Valim ac15a185fc Add always_evaluate_messages to Logger
Closes #12497
Closes #12480
2023-05-04 12:59:26 +02:00
José Valim bdad28e708 No need to revert trap exits 2023-03-24 23:17:16 +01:00
Kevin 2a3411d170 Update tests to new OTP start behaviour (#12490) 2023-03-23 15:07:24 +01:00
Andrea Leopardi 253e3ab640 Expose :logger's global metadata (#12413) 2023-02-17 11:21:41 +01:00
José Valim 318dd5297b Introduce default_formatter and default_handler config for Logger (#12400)
We now fully integrate with Erlang/OTP logger.

  * Logger.Formatter can now instantiate a compatible Erlamg/OTP logger formatter

  * The default_handler configures the default handler

  * The default_formatter configures the default formatter

  * Backends front-end will be moved to logger_backends package,
    but the implementation will still be shipped as part of Elixir
2023-02-15 17:31:18 +01:00
José Valim 26f6727eb8 Convert Logger translator into a logger filter (#12395)
The separation will help us extract the Logger
formatter into its own entity in future commits.
2023-02-14 09:12:37 +01:00
bbhoss cb2fd9db38 Add support for ports in Logger metadata (#12332)
Resolves #12328
2023-01-12 00:26:56 +01:00
sabiwara 29bf449f3f Evaluate formating charlists as ~c sigils (#12064) 2022-08-10 06:47:00 +02:00
José Valim 76a683f41c Add deprecations 2022-07-27 17:18:53 +02:00
José Valim 1b60acbe9e Allow LINE to be set for tests 2022-07-18 09:58:14 +02:00
José Valim 4b34231fb1 Allow :warning to configure Logger Console color 2022-05-15 23:30:44 +02:00
José Valim 4da2f8de7a Use :warning level for Logger threshold 2022-05-15 23:27:51 +02:00
Stefan Chrobot 7269438372 Add Logger.put_process_level/2 and rewrite enable/1 and disable/1 (#11691) 2022-03-10 10:16:22 +01:00
Jinkyou Son (Json) f4d14047f0 Deprecate levelpad of Logger.Formatter (#11633) 2022-02-17 08:17:40 +01:00
Eksperimental b5692822b1 Use ERTS instead of erts (#11362) 2021-11-04 08:18:19 +01:00
Riccardo Manfrin 56cfb4fedc Print Erlang levels in :console backend (#11304) 2021-10-09 16:56:30 +02:00
José Valim cf3e26048b Use translator_inspect_opts for translating reports too
Closes #11223.
2021-09-03 22:36:17 +02:00
José Valim d5b114a79c Add tests and update CHANGELOG 2021-04-09 13:07:16 +02:00
Łukasz Jan Niemier 9a0dba97e6 Add functions for application wise log levels (#10854)
* feat: add functions application wise log levels

* test: add tests for setting level for multiple modules at once
2021-04-09 12:49:17 +02:00
José Valim 3becc7eb25 Do not deadlock Logger if handler crashes on sync mode, closes #10420 2020-10-12 09:27:22 +02:00
José Valim 0187efb423 Fix order dependent tests in logger suite 2020-10-08 09:43:45 +02:00
Daniil Fedotov c1ed14b17e Restrict Logger.configure on config_change callback (#10388)
The `config_change` callback is called from `application_controller` process,
which is receiving env updates on releases. `Logger.configure` does a blocking
call to the `Logger` process, which calls `Application.put_env`

This causes a crash on logger config update.

The fix is to call `Logger.configure` only for the config that have not yet
been persisted.
2020-10-03 08:25:15 +02:00
Enrico Rivarola a19d8f05e6 Include Erlang severity level to Logger metadata (#10300) 2020-09-03 09:48:13 +02:00
José Valim 89e12d0737 Use to_string chars on Logger.Formatter 2020-08-25 08:23:50 +02:00
Łukasz Jan Niemier f49829d501 Properly handle GenServer message in logger translators (#10209)
When the logger report was in form of `%{label: term(), report: term()}`
the `report_cb` wasn't called and instead there was fall-back to the
"regular" formatter which could cause meaningless messages. This fixes
that by falling back to the "proper" `report_cb` in case when there was
no matching handler.
2020-07-28 16:39:17 +02:00
Mitchell Henke 291f5e41f2 include callers in translated Logger metadata for Task (#10111) 2020-06-19 20:50:48 +02:00
Wojtek Mach cba3f3ae10 Run formatter (#10090) 2020-06-09 22:49:27 +02:00
José Valim 1a2ec64a5c Make sure Logger.log/bare_log does not crash with :warn 2020-06-09 21:56:48 +02:00
Ryan Zidago 8fa9b0d954 Fix Task PID and caller in Task Supervisor reports (#10025)
Closes #10024
2020-05-09 01:14:09 +02:00
José Valim 212b0c41da Improve docs and coverege for module levels 2020-02-29 09:20:26 +01:00
Łukasz Jan Niemier 9fd97c2d29 Expose functions for setting per-module levels (#9793) 2020-02-29 09:16:38 +01:00
Łukasz Jan Niemier 3782b4b70e Add structured logging (#9797) 2020-02-28 16:22:31 +01:00
José Valim de65e94ef6 Only print metadata of known types, closes #9814 2020-02-12 19:03:53 +01:00
Łukasz Jan Niemier 4da85d8400 Expose all logger levels (#9791) 2020-02-09 09:40:56 +01:00
Łukasz Jan Niemier 5207a2b816 fix(logger): use correct return value from report_cb/2 (#9798)
Earlier it assumed that the return type is the same as in `report_cb/1`
which is not true. `report_cb/1` returns format string and data while
`report_cb/2` returns already formatted string.
2020-02-09 09:34:34 +01:00
Wojtek Mach da447cf011 Fix unused variable warnings (#9790) 2020-02-06 20:27:47 +01:00
Akash Hiremath ab05aa8d4a Fix logger truncate for multi-byte characters (#9767) 2020-01-31 10:44:30 +01:00
Eksperimental 0acab05f53 Use titlecase in Elixir, Erlang, EEx, Unicode, and Dialyzer (#9557) 2019-11-19 09:10:29 +01:00
Łukasz Jan Niemier 0c45373026 Handle case when report_cb needs 2 arguments (#9478) 2019-11-03 21:11:11 +01:00