From 22550188406d4956ad64aecde38190a2f72eeacd Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 29 Oct 2018 11:53:10 +0100 Subject: erts: Add erlang:system_flag(system_logger,_) This flag allows logger and other components to set the process which log messages from ERTS are to be sent. --- erts/doc/src/erlang.xml | 98 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 29 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index a42323b13d..7699f64c25 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -7539,7 +7539,39 @@ ok - + + Set system logger process. + +

Sets the process that will receive the logging + messages generated by ERTS. If set to undefined, + all logging messages generated by ERTS will be dropped. + The messages will be in the format:

+ +{log,Level,Format,ArgList,Metadata} where + +Level = atom(), +Format = string(), +ArgList = list(term()), +Metadata = #{ pid => pid(), + group_leader => pid(), + time := logger:timestamp(), + error_logger := #{ emulator := true, tag := atom() } + +

If the system_logger process dies, + this flag will be reset to logger.

+

The default is the process named logger.

+

Returns the old value of the flag.

+

This function is designed to be used by the + KERNEL logger. + Be careful if you change it to something else as + log messages may be lost. If you want to intercept + emulator log messages, do it by adding a specialized handler + to the KERNEL logger.

+
+
+ + + Set system flag trace_control_word.

Sets the value of the node trace control word to @@ -7553,7 +7585,7 @@ ok - Finalize the time offset. @@ -7703,8 +7735,9 @@ ok nif_version, otp_release, port_parallelism, - system_version, system_architecture, + system_logger, + system_version, trace_control_word, version, wordsize @@ -7876,7 +7909,7 @@ ok anchor="system_info_cpu_topology" since=""/> - + Information about the CPU topology of the system. @@ -8231,10 +8264,10 @@ ok - - - - + + + + Information about system time. @@ -8466,8 +8499,8 @@ ok - - + + Information about system schedulers. @@ -8889,19 +8922,20 @@ ok - - - - - - - - - - - - - + + + + + + + + + + + + + + Information about the system. @@ -9057,18 +9091,24 @@ ok +spp in erl(1).

- - system_version - -

Returns a string containing version number and - some important properties, such as the number of schedulers.

-
system_architecture

Returns a string containing the processor and OS architecture the emulator is built for.

+ + system_logger + +

Returns the current system_logger as set by + erlang:system_flag(system_logger, _).

+
+ + system_version + +

Returns a string containing version number and + some important properties, such as the number of schedulers.

+
trace_control_word -- cgit v1.2.3