1 HEAD~ Controlling what gets logged; NOBUG_ENV; environment variable for loging control
3 The `NOBUG_INIT_FLAG...` series of macros parse the environment variable
4 '$NOBUG_LOG'. This enviromnet variable is thus used to configure what is
5 logged at runtime. Its syntax is as following:
9 logdecl_list --> logdecl, any( ',' logdecl_list).
11 logdecl --> flag, opt(limitdecl, any(targetdecl)).
13 flag --> "identifier of a flag".
15 limitdecl --> ':', "LIMITNAME".
17 targetdecl --> '@', "targetname", opt(targetopts).
19 targetopts --> '(', "options for target", ')', opt(targetopts).
22 Roughly speaking, '$NOBUG_LOG' contains a comma separated list of declarations
23 for flags, which is the name of the flag followed by a limit which is all
24 written in uppercase letters and preceeded by a colon, followed by target
25 declarations which are the names of targets, introduced by an at sign. Target
26 declarations can have options, which are described in the next section. Limit
27 and target declarations are optional and defaults are selected from the
28 xref:loggingleveldefaults[table above]. The defaults presented here are
29 currently an approximation of what might be viable. The default values used
30 here may be redefined in a future release.
32 HEAD^ Targets and Options; loggingoptions; configure what gets logged
34 The Following options are available:
37 `(file=`'filename'`)`:::
38 set 'filename' for the backing ringbuffer
40 set size of the ringbuffer to 'nnn' bytes, rounded-off up to the next page
43 don't erase existing ringbuffer, start where it left off
45 keep file after application ends
47 unlink file instantly at creation
49 The default ringbuffer is a temporary file in '/tmp' with the `temp` option.
50 This means it will not be available and accessible for inspection, but it also
51 won't leave any stale data behind when the application ends.
56 redirect console output to fd 'n'
58 When running under a debugger, NoBug tries to use debugger facilities
59 to print console messages.
62 `(name=`'filename'`)`:::
65 append to (existing) logfile
69 global prefix for syslog
71 log to system console if syslog is down
73 include the process identifier in the log
75 log to stderr as well (Not available on all systems)
78 .How $NOBUG_LOG is used
81 # set limit to the default target and default limit
83 NOBUG_LOG='flag,other'
85 # set the limit of the default target to DEBUG
86 NOBUG_LOG='flag:DEBUG'
88 # set console and syslog limits for flag to DEBUG
89 NOBUG_LOG='flag:DEBUG@console@syslog'
91 # trace 'other' to a persistent ringbuffer
93 'other:TRACE@ringbuffer(file=log.rb)(size=8192)(keep)'