LogChannel
Internal
Not re-exported through require(Operator). This is not part of the public API and may move in a minor release. It is documented because understanding it matters when you are debugging, not because you should construct one. The internal path is ServerStorage.Operator.Server.LogChannel.
Serves log panel queries over the remote. It owns the permission check, the rate limit and the payload validation, so Transport only routes.
Functions
LogChannel.new
LogChannel.new(options: Options): LogChannelReturns a channel whose handle(player, payload) answers one query.
Checks run cheapest-first and bail at the first failure: connected, well-formed payload, permitted, within rate limit, then the query itself. A refusal sends back ok = false with a status and no records, never a reason a caller could probe with.
LogChannel.validate
LogChannel.validate(payload: any): (boolean, string?)Whether a query payload is well-formed: stream whitelisted, search a string within Protocol.MaxLogSearchLength, days and limit positive numbers and not NaN.
LogChannel.readCursor
LogChannel.readCursor(value: any): Cursor?Parses a client-supplied cursor, or nil if it is malformed. Rejects non-numbers, NaN, negatives and absurd offsets, and floors what it accepts.
Types
Options
type Options = {
actionLog: ActionLog?,
canViewLogs: ((player: Player) -> boolean)?,
logger: Log.Logger?,
send: (player: Player, messageType: string, payload: any) -> (),
isConnected: (player: Player) -> boolean,
takeToken: (player: Player) -> boolean,
}| Field | Meaning |
|---|---|
actionLog | the ActionLog to query; absent means Unavailable |
canViewLogs | permission predicate; absent means nobody can read logs |
send | how to reply to the player |
isConnected | re-checked after the query, since it can yield |
takeToken | the rate limiter; returning false refuses with RateLimited |
It fails closed
With no canViewLogs, every request is refused. A permission check that raises is a refusal, not an approval.
Statuses
| Status | Meaning |
|---|---|
Ok | records returned |
Denied | not permitted |
Unavailable | logging is off, or the query failed |
RateLimited | too many queries; try again shortly |
Invalid | the payload was malformed |