API reference / @jsprismarine/prismarine / network/PacketLogFilter / PacketLogFilter
Class: PacketLogFilter
Defined in: packages/prismarine/src/network/PacketLogFilter.ts:11
Decides which packets are worth a line in the log.
At silly level every packet in and out is written down, and a few of them are on a timer rather than on anything happening: SetTimePacket alone goes to every player twenty times a second. They bury whatever the log was opened to find, and there is no level that keeps the interesting traffic while dropping them - they are all the same kind of message.
So the filter is by name, from log-excluded-packets in the config.
Constructors
Constructor
new PacketLogFilter(
excluded?):PacketLogFilter
Defined in: packages/prismarine/src/network/PacketLogFilter.ts:14
Parameters
excluded?
Iterable<string> = []
Returns
PacketLogFilter
Methods
getExcluded()
getExcluded():
string[]
Defined in: packages/prismarine/src/network/PacketLogFilter.ts:36
The names being dropped, for reporting the filter back to whoever set it.
Returns
string[]
shouldLog()
shouldLog(
packet):boolean
Defined in: packages/prismarine/src/network/PacketLogFilter.ts:22
Parameters
packet
object
the packet about to be logged.
Returns
boolean
false if its name is excluded.
shouldLogName()
shouldLogName(
name):boolean
Defined in: packages/prismarine/src/network/PacketLogFilter.ts:31
The same check by class name, for a batch that keeps its packet objects until it is encoded.
Parameters
name
string
the packet class name.
Returns
boolean
false if the name is excluded.