storeLog method

dynamic storeLog({
  1. required String title,
  2. required String message,
  3. required LogLevel level,
  4. required String enviroment,
  5. dynamic jsonData,
})

Implementation

storeLog(
    {required String title,
    required String message,
    required LogLevel level,
    required String enviroment,
    dynamic jsonData}) {
  if (jsonData != null) {
    jsonData = jsonEncode(jsonData);
  }

  final logEntry = LogModel(
    title: title,
    message: message,
    level: Constants.logLevels[level]!,
    enviroment: enviroment,
    jsonData: jsonData,
  );
  logList.add(logEntry);
}