aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger_formatter.erl
AgeCommit message (Collapse)Author
2018-09-12[logger] Include single_line option to report_cbSiri Hansen
If the report callback function has two arguments, the second argument is a map with options to limit the size of the log event. To even allow a better formatting when the event shall be printed on a single line, the new option single_line is now included in this argument.
2018-09-12[logger] Remove encoding option from logger_formatterSiri Hansen
The encoding option was introduced in commit 270d909696a753af022df72a404c73f2895b4a02, to allow report callbacks to format according to a given encoding. There was, however, no connection between this encoding option, and the encoding of the device to which the logger handler was writing. Since a formatter is defined to return unicode:chardata(), and in order to avoid mismatch with the encoding of the device, the encoding option is now removed from the formatter. The handler itself must make sure that it does not write illegal data to its device.
2018-08-13[logger] Avoid unwanted commas introduced by formatter's single_line optionSiri Hansen
When printing a map with ~p in a log message, the formatter's single_line option in some cases introduced unwanted commas after '=>', for example: This is now corrected. When single_line==true, width 0 is added to all ~p and ~P control sequences in the format string.
2018-07-13[logger] Fix regexp replacement for unicode stringsSiri Hansen
2018-07-13[logger] Allow report callback with two arguments returning a stringSiri Hansen
If the report callback is a fun of arity 2, then the second argument is a map with the keys 'encoding', 'depth' and 'chars_limit', and the fun must return a string which is size limited according to the given depth and chars_limit. If the report callback is a fun of arity 1, then it must return a tuple containing a format string and a list of arguments. The formatter will produce the string, and limit it's size.
2018-06-18Update copyright yearHenrik Nord
2018-06-11[logger] Update documentationSiri Hansen
2018-06-11[logger] Change default primary log level to 'notice'Siri Hansen
Log events issued via error_logger:info_msg or error_logger:info_report are now forwarded to Logger with level 'notice' instead of 'info'. Log events issued by gen_* behaviours are also changed from level 'info' to level 'notice'. Progress reports are still 'info', and can therefore easily be included/excluded by changing the primary log level. By default, they are not logged.
2018-06-08[logger] Add if-exist functionality for metadata keys in formatter templateSiri Hansen
* Nested metadata keys are now expressed as list of atoms (was earlier tuples). * If-exist is expressed as: {Key,IfExist,Else} Key :: atom() | [atom()] IfExist :: template() Else :: template()
2018-05-23Update documentation of logger and error_loggerSiri Hansen
2018-05-23Change type name logger:log() to logger:log_event()Siri Hansen
2018-05-23Allow chars_limit to limit stringsSiri Hansen
Earlier, only reports and {Format,Args} was limited by chars_limit, and max_size was needed to limit the size of a string.
2018-05-23Use system_time instead of monotonic_time as timestamp in loggerSiri Hansen
2018-05-21Format logger timestamps according to RFC3339Siri Hansen
2018-05-21Improve santiy check of formatter configSiri Hansen
2018-05-21Remove logger env vars for format_depth, max_size and utcSiri Hansen
These are replaced by new config handling and must not be used any more.
2018-05-07Change return type from logger_formatter:format/2Siri Hansen
This used to be string() is now changed to unicode:chardata().
2018-05-03Set single_line=true by default in logger_formatterSiri Hansen
2018-04-26Add chars_limit option to logger_formatterSiri Hansen
2018-04-26Add loggerSiri Hansen