[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / [network/PacketLogFilter](https://jsprismarine.dev/api/@jsprismarine/prismarine/network/PacketLogFilter/index.md) / PacketLogFilter

# Class: PacketLogFilter

Defined in: [packages/prismarine/src/network/PacketLogFilter.ts:11](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/network/PacketLogFilter.ts#L11)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/network/PacketLogFilter.ts#L14)

#### Parameters

##### excluded?

`Iterable`\<`string`\> = `[]`

#### Returns

`PacketLogFilter`

## Methods

### getExcluded()

> **getExcluded**(): `string`[]

Defined in: [packages/prismarine/src/network/PacketLogFilter.ts:36](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/network/PacketLogFilter.ts#L36)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/network/PacketLogFilter.ts#L22)

#### 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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/network/PacketLogFilter.ts#L31)

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.
