getJsonStr static method

String getJsonStr({
  1. required Level level,
  2. required String? message,
  3. required DateTime time,
  4. required MyLogItem? content,
  5. String loggerName = "",
  6. int sequenceNumber = -1,
})

Implementation

static String getJsonStr({
  required Level level,
  required String? message,
  required DateTime time,
  required MyLogItem? content,
  String loggerName = "",
  int sequenceNumber = -1,
}) {
  assert(null != message || null != content);
  final remap = {
    "levelValue": level.value,
    "levelName": level.name,
    "message": message,
    "loggerName": loggerName,
    "time": time.millisecondsSinceEpoch,
    "sequenceNumber": sequenceNumber,
    "content": message ?? convert.jsonEncode(content!),
  };
  return convert.jsonEncode(remap);
}