Commit Graph
522 Commits
Author SHA1 Message Date
José Valim e7a03d2feb Reduce allocations in the logger translator module 2026-07-28 10:39:54 +02:00
José Valim 8a1bbb59df Warn on errors from orphan compiler modules 2026-07-28 10:19:21 +02:00
Łukasz Samson 1cb2089367 Tighten stdlib typespecs to match implementations (#15561)
Candidates found by cross-checking @specs against the type signatures
inferred by the compiler (see #15559): these specs declared strictly
wider return types than the functions can produce, where the gap
carries no intentional API room (deliberately abstract contracts, such
as atom() covering future values, are left untouched):

  * File.Stream.t/0: type the struct fields (mirrors IO.Stream.t/0)
  * Map.new/0: %{} instead of map()
  * Logger.levels/0: Exclude deprecated :warn
  * Macro.Env.location/1 and Macro.Env.stacktrace/1: precise shapes
2026-07-09 16:50:13 +02:00
Jean Klingler 83e9b66e65 Add to_unsafe_atom/1 and soft-deprecate to_atom/1 (#15494) 2026-06-16 20:50:11 +09: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
Łukasz Samson c14f3c7acb Fix arity of Logger.configure in warning message (#15298) 2026-04-21 22:04:04 +09:00
cui f16d2a32c1 Remove range overlap in Logger truncation (#15221) 2026-03-27 10:27:23 +01: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
Gonzalo R 21450cf838 docs(logger): :process_label is not really ever included in the metadata as of now (#14880) 2025-10-30 17:47:42 +01: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 bba5542393 Do not warn on conditional requires or requires from quote 2025-09-27 16:33:05 +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
Steve Cohen 1f786273e6 Fix filtering documentation (#14705)
The filtering documentation implied that the msg attribute of the
logger event map could be a binary, but according to the erlang types
(https://www.erlang.org/doc/apps/kernel/logger.html#t:log_event/0) it
can't be a binary.

This change updates the docs with an example that comports with the
actual typing.
2025-08-07 20:25:38 +02:00
dssecret 8344634bb6 Fix return value in logger filter docs (#14659)
Signed-off-by: dssecret <webmaster@deek.sh>
2025-07-20 09:21:07 +02:00
José Valim 1fb7ca159c Fix logger docs
Closes #14628.
Closes #14629.
2025-07-06 09:46:31 +02:00
Łukasz Samson e3f7759fde Replace keyword with concrete keyword lists in specs (#14611) 2025-06-30 17:24:28 +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
Rudolf Manusadzhian 9938105fb4 Fix tiny typo in Logger docs (#14527) 2025-05-24 15:29:17 +09:00
José Valim 920a6a0a42 Consistenly apply timeouts across suites (#14444)
Closes #14443.
2025-04-18 12:11:12 +02:00
Santiago Tortosa db6c536c30 Doc ref to inspect/2 for :translator_inspect_opts (#14420) 2025-04-10 11:15:40 +02:00
Jonatan Männchen f3e8ceb5aa Implement Test Coverage Reporting (#14343) 2025-04-07 22:37:01 +02:00
José Valim a87eb7dec4 Avoid collectable deprecation warning 2025-04-01 18:21:58 +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
José Valim d661840e5e Improve docs on custom handlers 2025-03-11 20:09:34 +01:00
Jonatan Männchen 980500551c Inline Licence Info & Copyright for non-test files (#14256) 2025-02-07 21:11:09 +01:00
Jonatan Männchen f7bbe81ea7 Inline licence info & copyright for test files (#14257) 2025-02-07 20:54:14 +01:00
José Valim 80aad3585c Ensure logger suite passes when IO.ANSI colors is disabled 2025-02-01 10:53:44 +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
peter madsen-mygdal 8994297ec6 Fix typo (#14033)
peformant -> performant
2024-12-05 19:02:43 +01:00
José Valim b75cccc8df Describe why Logger.flush is not advised in production 2024-12-05 13:10:58 +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
Jean Klingler fbeccf9681 Clarify that charlists cannot be used as logger metadata (#13977) 2024-11-07 16:26:48 +09:00
felipe stival 4c7e723bec Fix Logger.put_process_level/2 note (#13959)
The documentation for this function stated that it would override
primary logger level, which is not true.
2024-11-05 11:51:45 +01:00
José Valim 0a694164dc Clarify Logger formatter docs, closes #13962 2024-11-05 11:51:16 +01:00
José Valim 0c75027e1f Optimize bare_log invocation (#13956) 2024-11-03 15:44:35 +01:00
Tobias PfeifferandAndrea Leopardi 6cd46d76ee Improve docs for Logger overload protection (#13855)
The previous docs didn't mention that logger may drop messages
entirely. This should give a fair overview of the built-in overload
protections, similar to erlang/otp#8855.

---
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
2024-09-24 17:15:29 +02:00
Gonzalo 357793a6f0 Fix Logger docs layout (#13840) 2024-09-19 20:24:21 +02:00
Igor Goryachev 0d4d1e3db1 Fix logger translator tests under Erlang 27.1 (#13839) 2024-09-19 12:57:48 +02:00
Andreas Lappe 6d44df6573 Fix typo in docs of logger.ex (#13835) 2024-09-17 19:09:42 +02:00
Jean Klingler 1286a6257f Replace unless/2 usages in the codebase (#13808) 2024-09-06 16:22:51 +09:00
José Valim 17a01309e0 More improvements to Logger metadata 2024-08-12 14:31:55 +02:00