Logging class

A plugin that outputs a client's logs to stdout and stderr.

Inheritance

Constructors

Logging({Level stderrLevel = Level.WARNING, Level stackTraceLevel = Level.SEVERE, Level logLevel = Level.INFO, int? truncateLogsAt = 1000, bool censorToken = true, StringSink? stdout, StringSink? stderr})
Create a new instance of the Logging plugin.

Properties

censorToken bool
Whether to censor the token of clients this plugin is attached to.
final
clientType RuntimeType<Nyxx>
The type of client this plugin requires.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
logger Logger
A logger that can be used to log messages from this plugin.
no setterinherited
logLevel Level
The level above which logs are outputted.
final
name String
The name of this plugin.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTraceLevel Level
The level at which stack traces are automatically recorded.
final
stderr StringSink
The sink error messages are sent to.
final
stderrLevel Level
The level above which logs are outputted to stderr instead of stdout.
final
stdout StringSink
The sink normal messages are sent to.
final
truncateLogsAt int?
The number of characters after which log messages are truncated.
final

Methods

afterClose() FutureOr<void>
Called after each client this plugin is added to closes.
inherited
afterConnect(Nyxx client) FutureOr<void>
Called after each client this plugin is added to connects.
inherited
beforeClose(Nyxx client) FutureOr<void>
Called before each client this plugin is added to closes.
inherited
beforeConnect(ApiOptions apiOptions, ClientOptions clientOptions) → void
Called before each client this plugin is added to connects.
override
createState() FutureOr<NyxxPluginState<Nyxx, NyxxPlugin<Nyxx>>>
Called to create the state for this plugin.
inherited
doClose(Nyxx client, Future<void> close()) Future<void>
Perform the close operation.
override
doConnect(ApiOptions apiOptions, ClientOptions clientOptions, Future<Nyxx> connect()) Future<Nyxx>
Perform the connection operation.
inherited
interceptGatewayMessages(Shard shard, Stream<GatewayMessage> messages) Stream<GatewayMessage>
Intercept GatewayMessages by transforming the messages stream.
inherited
interceptRequest(Nyxx client, HttpRequest request, Future<HttpResponse> next(HttpRequest)) Future<HttpResponse>
Called whenever a request is made using a client's HttpHandler.
inherited
interceptShardMessages(Shard shard, Stream<ShardMessage> messages) Stream<ShardMessage>
Intercept ShardMessages by transforming the messages stream.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited