LoggerDatabase class

A simple database for logging information.

Logging can be done in memory or locally on the terminal.

The logs are recorded in an array of {time, parameters}. The name of the log is recorded in the @name key in the parameters.

It is possible to change the log save location by specifying onInitialize, onLoad, and onSaved appropriately.

ログの情報を記録するための簡易データベース。

メモリ上や端末ローカルにログを記録することができます。

{時間, パラメーター}の配列で記録されます。パラメーターの中の@nameキーにログの名前が記録されます。

onInitializeonLoadonSavedを適切に指定することでログの保存場所を変更することが可能です。

Available Extensions

Constructors

LoggerDatabase({Future<void> onInitialize(LoggerDatabase database)?, Future<void> onLoad(LoggerDatabase database)?, Future<void> onSaved(LoggerDatabase database)?})
A simple database for logging information.

Properties

hashCode int
The hash code for this object.
no setterinherited
onInitialize → (Future<void> Function(LoggerDatabase database)?)
Executed at Database initialization time.
final
onLoad → (Future<void> Function(LoggerDatabase database)?)
Executed when loading Database.
final
onSaved → (Future<void> Function(LoggerDatabase database)?)
Executed when saving the Database.
final
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
read() Future<Map<String, DynamicMap>>
Reads values from the database.
setLimit(int limit) → void
Set the log limit to limit.
setRawData(Map<DateTime, DynamicMap> data) → void
Each log data can be entered directly.
toString() String
A string representation of this object.
inherited
write(String name, {DynamicMap? parameters, DateTime? dateTime}) Future<void>
Pass name, the name of the log, and parameters parameters to save the log.

Operators

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

Constants

nameKey → const String
Key where the name of the log is stored.