Commit Graph
240 Commits
Author SHA1 Message Date
José Valim 8a1bbb59df Warn on errors from orphan compiler modules 2026-07-28 10:19:21 +02:00
José Valim 9412f483d7 Simplify logger test 2026-05-08 22:31:09 +02:00
Łukasz Samson bb21320928 Persist log level to app env in Logger.configure/1 (#15348)
Fixes #15347
2026-05-08 11:02:04 +02:00
Jean Klingler 2c54f9a64a More cleanup: remove compatibility code for OTP26- (#15166)
* Remove compatibility code for OTP26-

* Remove support for application/erlang+html docs v1

* Remove workaround for bug in older OTP versions

* Update OTP version checks

* Remove OTP25- skipping in tests

* More test cleanup
2026-03-10 16:12:36 +09:00
Michał Łępicki 6d5f43318c Allow specifying SEED when running tests (#15111)
this is helpful when reproducing flaky test failures
2026-02-25 09:12:15 +01:00
Andrew France ba86bebd4c Fix "always evaluate" for Logger anonymous function tuples (#15081)
Previously, when the configuration directive `always_evaluate_messages`
was set to true an exception was raised when a function that returns a
tuple was given to Logger:

  ```
  Logger.info(fn -> {"", []} end)
  ```

Would result in:

  ```
    ** (Protocol.UndefinedError) protocol String.Chars not implemented for Tuple

    Got value:

        {"", []}
  ```
2026-01-28 09:35:08 +01:00
José Valim 4c10b43e3d Do not crash on invalid metadata in deprecated backends, closes #14995 2025-12-04 11:57:49 +01:00
José Valim 7ef4a3be97 Ensure logger formatter works with chardata, closes #14921 2025-11-18 14:50:46 -08:00
José Valim 7eb5b3ae17 Reset ansi escapes before newlines in Logger
Closes #14855
Closes #14841
2025-10-24 12:19:14 +02:00
José Valim f9dbdb88c9 Accept any enumerable in Logger.metadata/1 2025-09-09 15:31:14 +02:00
Eksperimental 9ae79d1385 Format numbers with underscores to improve readability (#14735) 2025-08-30 19:25:48 +02:00
José Valim 09dcbf7566 Introduce deprecations scheduled for Elixir v1.20 2025-06-07 21:55:06 +02:00
José Valim b1053b75c5 Use binary appending now that we require Erlang/OTP 26
Prompt
======

There is a format/2 function in inspect/algebra.ex that
calls format/3 recursively that returns a list of binaries.
Instead of doing so, I want you to pass a binary as accumulator,
<<>>, and then instead of `[head | format(...)]`, on every
operation you will do `format(<<acc::binary, result::binary>>, ...)`.

Notes
=====

The assistant was able to detect an issue with `collapse/4`
but it was unable to fix it. That and the changes to
mix/tasks/format.ex were addressed manually.
2025-06-07 12:46:47 +02:00
José Valim 920a6a0a42 Consistenly apply timeouts across suites (#14444)
Closes #14443.
2025-04-18 12:11:12 +02:00
Jonatan Männchen f3e8ceb5aa Implement Test Coverage Reporting (#14343) 2025-04-07 22:37:01 +02:00
Alex Martsinovich 884de18a7a Preserve logger reports through translation by encapculating translated output in report_cb (#14380) 2025-04-01 18:16:04 +02:00
Alex Martsinovich edd2944bea Drop otp log events if handle_otp_reports is set to false (#14354) 2025-03-22 21:46:20 +01:00
Jonatan Männchen f7bbe81ea7 Inline licence info & copyright for test files (#14257) 2025-02-07 20:54:14 +01:00
José Valim cff55fbc88 Compute ANSI escaping lazily in Logger, closes #14248 2025-02-01 10:33:47 +01:00
José Valim 098c01a7ee Introduce deprecations scheduled for v1.19 2024-12-11 11:59:36 +01:00
José Valim 485ca72ae2 Infer types and use them across remote calls (#13981)
This also unifies handling of deterministic builds with Erlang/OTP
as well as warnings_as_errors.
2024-11-09 18:00:27 +01:00
Igor Goryachev 0d4d1e3db1 Fix logger translator tests under Erlang 27.1 (#13839) 2024-09-19 12:57:48 +02:00
Jean Klingler 1286a6257f Replace unless/2 usages in the codebase (#13808) 2024-09-06 16:22:51 +09:00
Jean Klingler 2eb85eaf4b Fix logger crash when :gen_statem format_status/2 returns non-tuple (#13684) 2024-06-22 20:14:09 +09:00
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