You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the **Log output level** setting, you can easily filter out some unnecessary information in the production environment.
28
-
29
-
The default value of the log output level is `4`, that is, all kinds of logs other than debug information will be output.
30
-
With some APIs given below, you can adjust the log output level to your own desired value.
31
-
29
+
With the **Log output level** setting, you can easily filter out some unnecessary information in the production
30
+
environment.
32
31
32
+
The default value of the log output level is `4`, that is, all kinds of logs other than debug information will be
33
+
output.
34
+
With some APIs given below, you can adjust the log output level to your own desired value.
33
35
34
36
### Set Output Configuration
35
37
36
-
Before using the general log interface, you need to modify some configuration settings of the log output according to your needs.
38
+
Before using the general log interface, you need to modify some configuration settings of the log output according to
39
+
your needs.
37
40
38
41
You can freely choose to send the log to the console, file or even a player by modifying the settings.
39
42
These settings can exist at the same time, for example, you can set to send to the console and file at the same time.
40
-
If you don't change any settings, by **default** the log will only be output to the console.
43
+
If you don't change any settings, by **default** the log will only be output to the console.
41
44
42
45
#### Set whether the log is output to the console
43
46
44
47
`logger.setConsole(isOpen[,logLevel])`
45
48
46
49
- Parameter:
47
-
- isOpen : `Boolean`
48
-
Set whether the log is output to the console
49
-
The switch is on by default.
50
-
- logLevel : `Integer`
51
-
(optional parameter) the log output level of the console, the default is `4`
52
-
- Return value: none
53
-
54
-
50
+
- isOpen : `Boolean`
51
+
Set whether the log is output to the console
52
+
The switch is on by default.
53
+
- logLevel : `Integer`
54
+
(optional parameter) the log output level of the console, the default is `4`
55
+
- Return value: none
55
56
56
57
#### Set whether the log is output to a file
57
58
58
59
`logger.setFile(filepath[,logLevel])`
59
60
60
61
- Parameter:
61
-
- filepath : `String`
62
-
Set the file path where logs are output.
63
-
If you pass in an empty string or `Null`, then output to a file is closed.
64
-
The switch is off by default.
65
-
- logLevel : `Integer`
66
-
(optional parameter) the minimum log output level of the file, the default is `4`
67
-
- Return value: none
68
-
69
-
If you want to output to a file, we recommend that you output the log uniformly to `BDS_Root_Directory/logs/` folder for easy organization and inspection.
70
-
62
+
- filepath : `String`
63
+
Set the file path where logs are output.
64
+
If you pass in an empty string or `Null`, then output to a file is closed.
65
+
The switch is off by default.
66
+
- logLevel : `Integer`
67
+
(optional parameter) the minimum log output level of the file, the default is `4`
68
+
- Return value: none
71
69
70
+
If you want to output to a file, we recommend that you output the log uniformly to `BDS_Root_Directory/logs/` folder for
71
+
easy organization and inspection.
72
72
73
73
#### Set whether the log is output to a certain player
74
74
75
75
`logger.setPlayer(player[,logLevel])`
76
76
77
77
- Parameter:
78
-
- player : `Player`
79
-
Set the target player object for sending logging output.
80
-
If it returns `Null`, output to the player is closed.
81
-
The switch is off by default
82
-
- logLevel : `Integer`
83
-
(optional parameter) The player's minimum log output level, defaults to `4`
84
-
- Return value: none
85
-
86
-
This is a function designed to facilitate in-game debugging. The log output to the player will be treated as a chat message and displayed on the target player's screen.
87
-
78
+
- player : `Player`
79
+
Set the target player object for sending logging output.
80
+
If it returns `Null`, output to the player is closed.
81
+
The switch is off by default
82
+
- logLevel : `Integer`
83
+
(optional parameter) The player's minimum log output level, defaults to `4`
84
+
- Return value: none
88
85
86
+
This is a function designed to facilitate in-game debugging. The log output to the player will be treated as a chat
87
+
message and displayed on the target player's screen.
89
88
90
-
### Output Log Function
89
+
### Output Log Function
91
90
92
91
After the setup is complete, you can use the function here to output the log.
93
92
@@ -99,32 +98,51 @@ After the setup is complete, you can use the function here to output the log.
0 commit comments