saveMessageList static method

LogError saveMessageList({
  1. required String logFileName,
  2. String logger = 'Main',
  3. bool append = false,
  4. bool flush = false,
  5. SaveFormat format = SaveFormat.text,
  6. bool clear = false,
})

Saves the message list to a file.

  • logFileName: The name of the file to save to.
  • logger: The logger name (defaults to "Main").
  • append: If true, appends to the file instead of overwriting.
  • format: The save format (defaults to SaveFormat.text).
  • clear: If true, clears the message list after saving.

Returns: A LogError indicating success or failure.

Implementation

static LogError saveMessageList(
    {required String logFileName,
    String logger = 'Main',
    bool append = false,
    bool flush = false,
    SaveFormat format = SaveFormat.text,
    bool clear = false}) {
  return isCriticalMode
      ? LogError(-5, message: 'is in critical mode')
      : loggerManager.saveMessageList(logFileName,
          append: append,
          logger: logger,
          format: format,
          flush: flush,
          clear: clear);
}