diff options
author | Siri Hansen <[email protected]> | 2019-03-04 12:02:26 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2019-03-04 12:02:26 +0100 |
commit | 6d795779f770deb1829e1df2fa4a75f41e602d35 (patch) | |
tree | e94d7ca27da1b9e5a6fb10e28927518097e57664 /lib/kernel/doc/src | |
parent | df25e742f1ab87f8dbb290eed8e24ec919c3780a (diff) | |
parent | 615d36fab80acb1638f904b16a2f6cec93ce07a6 (diff) | |
download | otp-6d795779f770deb1829e1df2fa4a75f41e602d35.tar.gz otp-6d795779f770deb1829e1df2fa4a75f41e602d35.tar.bz2 otp-6d795779f770deb1829e1df2fa4a75f41e602d35.zip |
Merge branch 'siri/logger/os-timestamp/OTP-15625' into maint
* siri/logger/os-timestamp/OTP-15625:
Update preloaded
[logger] Change timestamp from erlang:system_time to os:system_time
Diffstat (limited to 'lib/kernel/doc/src')
-rw-r--r-- | lib/kernel/doc/src/logger.xml | 24 |
1 files changed, 21 insertions, 3 deletions
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 <list> <item><c>pid => self()</c></item> <item><c>gl => group_leader()</c></item> - <item><c>time => erlang:system_time(microsecond)</c></item> + <item><c>time => logger:timestamp()</c></item> </list> <p>When a log macro is used, Logger also inserts location information:</p> @@ -288,8 +288,8 @@ logger:error("error happened because: ~p", [Reason]). % Without macro <name name="timestamp"/> <desc> <p>A timestamp produced - with <seealso marker="erts:erlang#system_time-1"> - <c>erlang:system_time(microsecond)</c></seealso>.</p> + with <seealso marker="#timestamp-0"> + <c>logger:timestamp()</c></seealso>.</p> </desc> </datatype> </datatypes> @@ -1117,6 +1117,24 @@ logger:set_proxy_config(maps:merge(Old, Config)). a key-value list before formatting as such.</p> </desc> </func> + + <func> + <name name="timestamp" arity="0" since="OTP @OTP-15625@"/> + <fsummary>Return a timestamp to insert in meta data for a log + event.</fsummary> + <desc> + <p>Return a timestamp that can be inserted as the <c>time</c> + field in the meta data for a log event. It is produced with + <seealso marker="kernel:os#system_time-1"> + <c>os:system_time(microsecond)</c></seealso>.</p> + <p>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.</p> + </desc> + </func> + </funcs> <section> |