Skip to content
Zubair Rehman edited this page May 6, 2019 · 2 revisions

Welcome to the Flogs wiki!

FLogs is written in dart. It basically features two types of loggers (FLog & DataLog) with many of advanced features needed for logging. Logs are saved in database which can then be exported in document directory of Android |iOS device. Logs can be compressed and exported as zip file or they can be read as plain String. All configuration is done on logs configuration file. FLogs must be provided with the configuration before using any of its methods.

FLog

These are hourly log and comes with 4 different logging levels INFO, WARNING, ERROR & SEVER. A separate file will be created every hour to easily find data during debugging. These logs can be used using 'FLog' object.

FLog.logThis(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log",
      type: LogLevel.INFO);

DataLogs

These are custom log files with a distinct name. There are some types provided in this library, but other types can be added too. These types are defined in configuration like this:

dataLogTypes = [
      DataLogType.DEVICE.toString(),
      DataLogType.NETWORK.toString(),
    ]

These logs can be used using 'FLog' object.

FLog.logThis(
      className: "HomePage",
      methodName: "_buildRow1",
      text: "My log",
      type: LogLevel.SEVERE,
      dataLogType: DataLogType.DEVICE.toString());

Logs Configuration

Name Default Value Description
isDebuggable true To see output in Logcat
customClosingDivider "" Custom formatting closing character
customOpeningDivider "" Custom formatting opening character
csvDelimiter ", " Delimiter required only for FormatType.CSV
isLogEnabled true If this flag is false, no logging will be done
encryptionEnabled false If true, encryption will be applied on logs
encryptionKey "" Key used for encryption/decryption
formatType FormatType.FORMAT_CURLY Default log formating i.e, {String}
logLevelsEnabled List() Levels like Info, Warning, Error, Severe must be added here to enable
dataLogTypes List() Types of logs must be added here, required only for DataLogs
timestampFormat TimeStampFormat.DATE_FORMAT_1 TimeStamp format in FLogs log files
isDevelopmentDebuggingEnabled false To see development related logs in logcat