KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Enhanced Debug Log recording in v14
PRODUCT: 4D | VERSION: 14.1 | PLATFORM: Mac & Win
Published On: September 14, 2015

Prior to v14, the Debug log recording had 4 or less choices to set the logging options when using the SET DATABASE PARAMETER command. In v14, there are a more options to record on entering a longint value containing the following bit field format:

value = (bit1(1)+bit2(2)+bit3(4)+bit4(8)+…)

Where:
- Bit 1 (value 1) requests to enable the file (note that any other non-null value also enables it as well)
- Bit 2 (value 2) requests call parameters to methods and commands.
- Bit 3 (value 4) enables new tabbed format.
- Bit 4 (value 8) disables immediate writing of each operation on disk (enabled by default). Immediate writing is slower but more effective, for example for investigating causes of a crash. If you disable this mode, the file contents are more compact and are generated more quickly.
- Bit 5 (value 16) disables recording of plug-in calls (enabled by default).
Execution times (in milliseconds) are always included in the file. The "< ms" value is displayed when an operation lasts less than one millisecond.

Here are some examples of the calls and logs:

1. SET DATABASE PARAMETER (34;1)

// Enables the file to have runtime duration (in red) using option #1 in the v13 format.

------------------------------------------- v13 format -----------------------------------------------
· Time elapsed since the start of the log in milliseconds
· 4D process id
· Unique 4D process id
· Depth of calling stack
· Id of the 4D command or method name
· Runtime duration in milliseconds
----------------------------------------------------------------------------------------------------------

5 p=1 puid=11 (0) meth: Method3
5 p=1 puid=11 (0) end_meth: Method3. < ms
5 p=1 puid=11 (0) form: Form1 during OnClicked
5 p=1 puid=11 (1) cmd: Form event
5 p=1 puid=11 (1) end_cmd: Form event. < ms
5 p=1 puid=11 (0) end_form: Form1 during OnClicked. < ms
632 p=1 puid=11 (0) obj: Form1.Button1 during OnClicked
632 p=1 puid=11 (1) meth: Method2
632 p=1 puid=11 (2) cmd: C_TEXT
632 p=1 puid=11 (2) end_cmd: C_TEXT. < ms
632 p=1 puid=11 (1) end_meth: Method2. < ms
632 p=1 puid=11 (0) end_obj: Form1.Button1 during OnClicked. < ms
632 p=1 puid=11 (0) form: Form1 during OnClicked
632 p=1 puid=11 (1) cmd: Form event
632 p=1 puid=11 (1) end_cmd: Form event. < ms
632 p=1 puid=11 (0) end_form: Form1 during OnClicked. < ms
2520 p=1 puid=11 (0) obj: Form1.Button2 during OnClicked

2. SET DATABASE PARAMETER (34;2)

// Enables the file to have parameters (in blue) and runtime duration (in red) using option #2 in the v13 format.

------------------------------------------- v13 format -----------------------------------------------
· Time elapsed since the start of the log in milliseconds
· 4D process id
· Unique 4D process id
· Depth of calling stack
· Id of the 4D command or method name with (parameters)
· Runtime duration in milliseconds
----------------------------------------------------------------------------------------------------------

2520 p=1 puid=11 (1) cmd: SET DATABASE PARAMETER
2520 p=1 puid=11 (1) end_cmd: SET DATABASE PARAMETER. < ms
2520 p=1 puid=11 (1) meth: Method3
2520 p=1 puid=11 (1) end_meth: Method3. < ms
2520 p=1 puid=11 (0) end_obj: Form1.Button2 during OnClicked. < ms
2520 p=1 puid=11 (0) form: Form1 during OnClicked
2520 p=1 puid=11 (1) cmd: Form event
2520 p=1 puid=11 (1) end_cmd: Form event. < ms
2520 p=1 puid=11 (0) end_form: Form1 during OnClicked. < ms
2975 p=1 puid=11 (0) obj: Form1.Button3 during OnClicked
2976 p=1 puid=11 (1) meth: Method2
2976 p=1 puid=11 (2) cmd: C_TEXT($text2)
2976 p=1 puid=11 (2) end_cmd: C_TEXT($text2). < ms
2976 p=1 puid=11 (1) end_meth: Method2. < ms
2976 p=1 puid=11 (0) end_obj: Form1.Button3 during OnClicked. < ms
2976 p=1 puid=11 (0) form: Form1 during OnClicked
2976 p=1 puid=11 (1) cmd: Form event
2976 p=1 puid=11 (1) end_cmd: Form event. < ms
2976 p=1 puid=11 (0) end_form: Form1 during OnClicked. < ms
3808 p=1 puid=11 (0) obj: Form1.Button4 during OnClicked

3. SET DATABASE PARAMETER (34;2+4)

// Enables the file to have parameters (in blue) and runtime duration (in red) using option #2 and the v14 format with option #4.

------------------------------------------- v14 format -----------------------------------------------
· Sequence number that is unique
· Time stamp in the format “hh:mm:ss:milliseconds”
· 4D process id
· Unique 4D process id
· Depth of calling stack
· Id of the 4D command or method name
· Operation type (1 = 4D command, -1 = end of 4D command, 2 = project method, -2 = end of project method, parameter)
· Form event
· Runtime duration in microseconds
----------------------------------------------------------------------------------------------------------

95    10:53:49:148    1    11    1    94        -1    0    24
96    10:53:49:148    1    11    1    Method3        2    4    
97    10:53:49:148    1    11    1    96        -2    4    86
98    10:53:49:148    1    11    0    93        -2    4    246
99    10:53:49:148    1    11    0    Form1        2    4    
100    10:53:49:148    1    11    1    388        1    0    
101    10:53:49:148    1    11    1    100        -1    0    12
102    10:53:49:148    1    11    0    99        -2    4    47
103    10:53:49:580    1    11    0    Form1.Button5        2    4    
104    10:53:49:580    1    11    1    Method2        2    4    
105    10:53:49:580    1    11    2    284    $text2    1    0    
106    10:53:49:580    1    11    2    105        -1    0    23
107    10:53:49:580    1    11    1    104        -2    4    63
108    10:53:49:580    1    11    0    103        -2    4    169
109    10:53:49:580    1    11    0    Form1        2    4    
110    10:53:49:580    1    11    1    388        1    0    
111    10:53:49:580    1    11    1    110        -1    0    9
112    10:53:49:580    1    11    0    109        -2    4    37
113    10:53:50:300    1    11    0    Form1.Button6        2    4    

4. SET DATABASE PARAMETER (34;1+4)

// Enables the file to have runtime duration (in red) using option #1 and the //v14 format with option #4.

------------------------------------------- v14 format -----------------------------------------------
· Sequence number that is unique
· Time stamp in the format “hh:mm:ss:milliseconds”
· 4D process id
· Unique 4D process id
· Depth of calling stack
· Id of the 4D command or method name
· Operation type (1 = 4D command, -1 = end of 4D command, 2 = project method, -2 = end of project method)
· Form event
· Runtime duration in microseconds
----------------------------------------------------------------------------------------------------------

114    10:53:50:301    1    11    1    642    34;5    1    0    
115    10:53:50:301    1    11    1    114        -1    0    36
116    10:53:50:301    1    11    1    Method3        2    4    
117    10:53:50:301    1    11    1    116        -2    4    91
118    10:53:50:301    1    11    0    113        -2    4    1402
119    10:53:50:301    1    11    0    Form1        2    4    
120    10:53:50:301    1    11    1    388        1    0    
121    10:53:50:301    1    11    1    120        -1    0    12
122    10:53:50:301    1    11    0    119        -2    4    44
123    10:53:50:741    1    11    0    Form1.Button7        2    4    
124    10:53:50:741    1    11    1    Method2        2    4    
125    10:53:50:741    1    11    2    284        1    0    
126    10:53:50:741    1    11    2    125        -1    0    15
127    10:53:50:741    1    11    1    124        -2    4    53
128    10:53:50:741    1    11    0    123        -2    4    145
129    10:53:50:741    1    11    0    Form1        2    4    
130    10:53:50:741    1    11    1    388        1    0    
131    10:53:50:741    1    11    1    130        -1    0    10
132    10:53:50:741    1    11    0    129        -2    4    37
133    10:53:51:244    1    11    0    Form1.Button8        2    4    


See Also: