Squadron class
Squadron singleton. The main application thread and each worker thread will have their own private Squadron singleton.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Static Properties
- debugMode ↔ bool
-
Flag indicating whether Squadron runs in debug mode. When running in debug mode, messages logged at
SquadronLogLevel.debug level will be logged regardless of the current logLevel.
getter/setter pair
- id → String?
-
Squadron instance id to track identity of threads/workers. Returns an empty String if the Squadron singleton
has not been initialized yet, or if its
id
has not been set yet.no setter - isInitialized → bool
-
Whether the Squadron singleton is initialized or not. This property will be
true
if any of these has been called: pushLogLevel, setLogger, setId, setParent, or if logLevel has been set. The Squadron singleton may be reset by calling shutdown.no setter - logLevel ↔ int
-
Gets the logLevel. Propagates to workers with the value that was set at the time the worker
was created. Changes to this property do not propagate to workers after they have started.
getter/setter pair
- parentChannel → WorkerChannel?
-
WorkerChannel
to communicate with the parent. In the main thread, this will benull
.no setter
Static Methods
-
config(
dynamic message) → void - Logs a message at SquadronLogLevel.config level
-
debug(
dynamic message) → void -
Logs a message at SquadronLogLevel.debug level. If Squadron.debugMode is
true
, the message will be displayed regardless of Squadron.logLevel. Iffalse
, the message will be logged if Squadron.logLevel is set to SquadronLogLevel.all. -
fine(
dynamic message) → void - Logs a message at SquadronLogLevel.fine level
-
finer(
dynamic message) → void - Logs a message at SquadronLogLevel.finer level
-
finest(
dynamic message) → void - Logs a message at SquadronLogLevel.finest level
-
info(
dynamic message) → void - Logs a message at SquadronLogLevel.info level
-
popLogLevel(
) → int? -
Restores the logLevel to the value it had before the last call to pushLogLevel. If pushLogLevel
was never called, this method has no effect and return
null
. Otherwise, it returns the value of logLevel after it has been restored. -
pushLogLevel(
[int? value]) → void -
Remembers the current logLevel, then setting it to
value
if not null. See popLogLevel. -
setId(
String value) → void -
Sets the Squadron instance
id
. Once set, the id cannot be modified. The only way to assign a newid
is to first call shutdown, then initialize a new Squadron instance. -
setLogger(
SquadronLogger? logger) → void -
Sets the current
logger
and sets the logger's SquadronLogger.logLevel to Squadron.logLevel. -
setParent(
WorkerChannel parentChannel) → void -
Sets the
WorkerChannel
to communicate with the parent. Once set, theparentChannel
cannot be modified. When setting the parent channel, this method also installs a logger to forward log messages to the parent. -
severe(
dynamic message) → void - Logs a message at SquadronLogLevel.severe level
-
shout(
dynamic message) → void - Logs a message at SquadronLogLevel.shout level
-
shutdown(
) → void -
Resets the Squadron singleton. isInitialized will return
false
after this call, and a new Squadron singleton may be reinitialized. -
warning(
dynamic message) → void - Logs a message at SquadronLogLevel.warning level