Skip to content

Commit

Permalink
* adding clear_debug_level (fluffos#1026)
Browse files Browse the repository at this point in the history
* updating set_debug_level
* updating debug_levels
  • Loading branch information
gesslar authored and lostsnow committed Mar 12, 2024
1 parent 5222fbf commit 9d59594
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 22 deletions.
27 changes: 26 additions & 1 deletion docs/efun/general/clear_debug_level.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,30 @@ title: general / clear_debug_level

### DESCRIPTION

TBW
This efun will toggle off the debug level for the specified option. The
options are the same as for set_debug_level() when using a string.

call_out
d_flag
connections
mapping
sockets
comp_func_tab
LPC
LPC_line
event
dns
file
add_action
telnet
websocket

### EXAMPLE

```c
clear_debug_level("call_out");
```
### SEE ALSO
set_debug_level(), debug_levels()
2 changes: 1 addition & 1 deletion docs/efun/internals/debug_levels.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ title: internals / debug_levels
```
### SEE ALSO
set_debug_level()
clear_debug_level(), set_debug_level()
48 changes: 28 additions & 20 deletions docs/efun/internals/set_debug_level.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: internals / set_debug_level

### SYNOPSIS

void set_debug_level( int level );
void set_debug_level( int | string level );

### DESCRIPTION

Expand All @@ -22,29 +22,37 @@ title: internals / set_debug_level
The information is printed to stdout as well as to the file specified in
the runtime configuration file as the "debug log file" setting.

The level is a bitmask, with the following bits defined:
call_out 1 << 0
d_flag 1 << 2
connections 1 << 3
mapping 1 << 4
sockets 1 << 5
comp_func_tab 1 << 6
LPC 1 << 7
LPC_line 1 << 8
event 1 << 9
dns 1 << 10
file 1 << 11
add_action 1 << 12
telnet 1 << 13
websocket 1 << 14

Setting a new level will replace the old one.
Setting a level of 0 will disable all debugging.
The level is a bitmask integer or a string. If using an integer, multiple
levels can be set by using the bitwise OR operator (|).

The following levels are available:
"call_out" 1 << 0
"d_flag" 1 << 2
"connections" 1 << 3
"mapping" 1 << 4
"sockets" 1 << 5
"comp_func_tab" 1 << 6
"LPC" 1 << 7
"LPC_line" 1 << 8
"event" 1 << 9
"dns" 1 << 10
"file" 1 << 11
"add_action" 1 << 12
"telnet" 1 << 13
"websocket" 1 << 14

When level is an integer, the debug level will be set to that value,
erasing any previous settings.

If level is a string, the debug level for that option will be toggled on,
while all other options will be preserved.

### EXAMPLES
```c
set_debug_level( (1 << 0) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) );
set_debug_level("call_out");
```
### SEE ALSO
debug_levels()
clear_debug_level(), debug_levels()

0 comments on commit 9d59594

Please sign in to comment.