Log class final
Constructors
-
Log.new({Object classLocation = '', String functionLocation = '', Map<
String, dynamic> ? monitor, Map<String, dynamic> ? debug, List<History> ? historyList}) -
Log.const$([String classLocation = '', String functionLocation = '', Map<
String, dynamic> _monitor = const {}, Map<String, dynamic> _debug = const {}, List<History> _historyList = const []]) -
const
Properties
- classLocation → String
-
final
- functionLocation → String
-
final
- hashCode → int
-
properties に依存.
no setterinherited
- location → String
-
no setterinherited
-
properties
→ Map<
String, Object> -
inactivate(), = operator, [] operator, など に依存されている.
no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
LoggerResultInterface loggerLoggerResultInterface) → void -
_historyList
に追加する. -
debug(
Map< String, dynamic> map) → Log -
Execute only when running debug.
Addmap
to_debug
-
getDebug(
) → Map< String, dynamic> -
inherited
-
getHistory(
Object classLocation, String functionLocation) → List< History> -
inherited
-
getHistoryList(
) → List< History> -
inherited
-
getMonitor(
) → Map< String, dynamic> -
inherited
-
inactivate(
) → Map< String, Object> -
test 時 property の一部を無効化する(一定の値に変更する), 等価比較を行うための method.
例えば process id など, system によって割り振られる値をこちらで指定できないので 等価比較ができない.
inherited -
monitor(
Map< String, dynamic> map) → Log -
Always run.
Addmap
to_monitor
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toInactivatedJson(
) → Map< String, dynamic> -
test 時に 等価比較が行えるように 一部の property 値を無効化する(一定の値に変更する)処理を加えた json を出力する.
例えば process id など, system によって割り振られる値をこちらで指定できないので このような場合に利用する.
inherited -
toJson(
) → Map< String, dynamic> -
ここでの toJson とは json へ encode 可能な形式へ変換するという意味で使われる.
つまり json string を返すというわけではない.
また serialize としても利用するため deserialize 可能でなければならない.
inherited -
toNestedStructureMap(
) → Map< String, Object> -
条件分岐で利用するため用意した.
inherited
-
toNestedStructureMapEntry(
) → MapEntry< String, Object> -
Map ではなく MapEntry である必要性 まず 前提として key 名には 型 を使う. しかし それだと同じ key 名になってしまうことがあり そうなると 上書きされてしまい これを防ぐ必要がある. root の key 名は 型 のみだが nest された key 名は 型 + 接頭辞 or 接尾辞 とする. nest された型の key 名を編集するにあたり MapEntry がやりやすい.
それぞれの値の返し方
- AggregationPattern で toShorthand を実装 toShorthand の処理は定義側が自由に定義する. だいたいは csv のようなコンマ区切りの値をまとめた1行表示を想定している. 多重入れ子構造の class の場合一番深い class にこの toShorthand が定義されていることを期待している. 一番深い class は すべての property が ValuePattern であるはずなので.
- AggregationPattern で toShorthand を未実装 これは 階層の上の部分を想定しており これらは自分が property としてもつ AggregationPattern.toNestedStructureMapEntry.value, ValuePattern.value などを呼ぶことを想定.
- IterablePattern
- IterablePattern
- IterablePattern
inherited -
toString(
) → String -
properties に依存.
inherited
Operators
-
operator ==(
Object other) → bool -
instance properties の toString() をそれぞれ比較し合う。
properties, [] operator に依存.
inherited
-
operator [](
String key) → Object -
properties から、operator == の内容を自動更新できるようにするために定義している.
inherited