José Valim
69999ec013
Clarify the data types of the metadata options
...
Closes #13546 .
2024-05-08 22:10:06 +02:00
José Valim
b378a2d560
Ensure translators are persisted across logger restarts
2024-05-01 11:35:01 +02:00
David JULIEN
c5816a227f
Add :all and :none for Logger.level/0 ( #13513 )
...
According to https://www.erlang.org/doc/man/logger#get_primary_config-0 and https://www.erlang.org/doc/man/logger#type-primary_config ,
returned type for `:logger.get_primary_config` is:
```erlang
#{level => level() | all | none,
metadata => metadata(),
filter_default => log | stop,
filters => [{filter_id(), filter()}]}
```
Thus, inside `Logger.level/0` fun, `level` could also be `all` and `none` when calling:
```elixir
%{level: level} = :logger.get_primary_config()
```
2024-04-26 12:29:52 +02:00
felipe stival
b0dbfa7ac6
Add @doc :since to Logger.{get, put, delete}_process_level/2 ( #13508 )
2024-04-23 08:22:08 +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
Jean Klingler
4f66663e06
Logger handles :process_label from OTP27 ( #13392 )
2024-03-05 22:31:05 +09:00
José Valim
c3ed7bb2e5
Improve Logger docs, closes #13313
2024-02-02 15:28:54 +01:00
José Valim
bfd1330d16
Handle invalid :time in metadata, closes #13190
2023-12-29 16:29:36 +01:00
Zeke Dou and c4710n
1ef9eaf900
Add Logger.levels/0 ( #13136 )
...
Co-authored-by: c4710n <c4710n@users.noreply.github.com >
2023-11-23 15:08:31 +01:00
Andrea Leopardi
374a2e1c6f
Add missing @spec to some Logger functions ( #13140 )
2023-11-23 13:15:51 +01:00
Andrea Leopardi
f547a752fc
Fix typo in Logger docs
2023-11-23 12:08:39 +01:00
José Valim
dfbb61b45b
Improve Logger docs, closes #13119
2023-11-22 09:23:17 +08:00
Marco Milanesi
a346c4f428
Add metadata examples to logger documentation ( #13064 )
2023-11-02 12:45:18 +01:00
José Valim
7ff58d75f5
Fix warnings and messages on Erlang/OTP 25
2023-10-31 08:02:15 +01:00
Panagiotis Nezis
33be0abbf4
Fix misc typos ( #12844 )
2023-08-07 11:37:03 +02:00
Adam Kirk
cf37d0a676
Add filtering docs to Logger ( #12827 )
2023-08-02 11:51:51 +02:00
Andrea Leopardi
15ce8706e2
Fix many small typos
2023-07-09 16:23:18 +02:00
Cristiano Piemontese
2ee7b59921
Add missing p in docs ( #12768 )
2023-07-07 12:10:18 +02:00
José Valim
8bc67d384b
Use PID valid for 32-bit systems, closes #12741
2023-07-02 10:28:58 +02:00
José Valim
028dbd71a2
Do not assume Logger has been loaded at compile-time
2023-06-27 15:02:20 +02:00
José Valim
7303e58d2b
Handle :function metadata properly, closes #12703
2023-06-23 13:07:04 +02:00
José Valim
7b3558d030
Improve Logger docs
2023-06-18 17:12:18 +02:00
José Valim
7454333fd0
Require pin variable when accessing variable inside binary size in match, closes #12588
2023-05-26 16:35:36 +02:00
José Valim
755c8393b6
mix format
2023-05-25 17:56:11 +02:00
Łukasz Samson
02d6b24340
fix typo and improve warning message ( #12600 )
2023-05-25 15:34:00 +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
Christopher Keele
aecd523c39
Convert Logger's default_handler config into maps ( #12538 )
...
If the `:config` provided to `:default_handler` is
a keyword list, we will now convert it into a map
as expected by `:logger_std_h`, to support deep
`Config.config` keyword list merging.
2023-04-30 09:59:05 +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
sabiwara
07086a9bec
Fix logger formatting in OTP26 ( #12434 )
2023-03-23 14:11:50 +01:00
José Valim
53cd4f7c7a
Document ansi_color metadata, closes #12489
2023-03-23 13:50:49 +01:00
José Valim
d6972b3892
Update CHANGELOG
2023-03-08 13:59:53 +01:00
Andrea Leopardi
58797d9387
Fix "@doc since" for some Logger macros ( #12429 )
...
Some metaprogramming was leading to `@doc since: "1.11.0"` being used
for all generated Logger macros. Instead, it should be present only for
"newer" Erlang levels (such as "notice" or "critical"), and not levels
such as "error" which were always present in Elixir.
2023-02-27 15:51:13 +01:00
Andrea Leopardi
253e3ab640
Expose :logger's global metadata ( #12413 )
2023-02-17 11:21:41 +01:00
Andrea Leopardi and José Valim
7dac919d2b
Add Logger.add_handlers/1 ( #12412 )
...
Co-authored-by: José Valim <jose.valim@dashbit.co >
2023-02-17 10:35:37 +01:00
Andrea Leopardi
48d3365cd6
Add spec to Logger.default_formatter/1 ( #12406 )
2023-02-16 12:43:52 +01:00
José Valim
bb6a218b1b
Finish LoggerBackends extraction
2023-02-16 10:04:17 +01:00
José Valim
49893b635d
Use ~c for filename
2023-02-15 17:39:49 +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
José Valim
dea8b432ea
Remove unnecessary nil clause ( #12329 )
2023-01-11 09:48:56 +01:00
José Valim
72988c7843
Document not all metadata can be replaced, closes #12316
2023-01-04 12:06:58 +01:00
José Valim
0a1a5991d9
Remove unecessary parens in nullary type funs
2022-10-14 13:55:23 +02:00
Parker Selbert
b67e722d68
Define a callback for Logger.Translator ( #12177 )
2022-10-07 09:01:37 +02:00