From 00678f41aaa14191dc333596fee33075ce515e24 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 22 Feb 2019 14:26:07 +0100 Subject: [logger] Change timestamp from erlang:system_time to os:system_time This is to align the timestamps with external logs. --- lib/kernel/doc/src/logger.xml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'lib/kernel/doc/src') diff --git a/lib/kernel/doc/src/logger.xml b/lib/kernel/doc/src/logger.xml index df2d081d76..e6448e144e 100644 --- a/lib/kernel/doc/src/logger.xml +++ b/lib/kernel/doc/src/logger.xml @@ -190,7 +190,7 @@ logger:error("error happened because: ~p", [Reason]). % Without macro pid => self() gl => group_leader() - time => erlang:system_time(microsecond) + time => logger:timestamp()

When a log macro is used, Logger also inserts location information:

@@ -288,8 +288,8 @@ logger:error("error happened because: ~p", [Reason]). % Without macro

A timestamp produced - with - erlang:system_time(microsecond).

+ with + logger:timestamp().

@@ -1117,6 +1117,24 @@ logger:set_proxy_config(maps:merge(Old, Config)). a key-value list before formatting as such.

+ + + + Return a timestamp to insert in meta data for a log + event. + +

Return a timestamp that can be inserted as the time + field in the meta data for a log event. It is produced with + + os:system_time(microsecond).

+

Notice that Logger automatically inserts a timestamp in the + meta data unless it already exists. This function is + exported for the rare case when the timestamp must be taken + at a different point in time than when the log event is + issued.

+
+
+
-- cgit v1.2.3