Skip to content

Log Types

Muhammad Umair Adil edited this page Sep 12, 2018 · 1 revision

Log Types

There are some predefined log types that can be used along with custom type. For each type defined in builder, logger object will be created and provided for later use.

    1. LogType.Device //To Log device related data
    2. LogType.Location //To Log Locations
    3. LogType.Notification //To Log notifications
    4. LogType.Network //To Log network calls
    5. LogType.Navigation //To Log user screen navigation
    6. LogType.History //To Log device & app history 
    7. LogType.Tasks //To Log Tasks performed
    8. LogType.Jobs //To Log Jobs data

Add these types to your Log configuration like this:

    val logsConfig = LogsConfig(logTypesEnabled = arrayListOf(
                                LogType.Notification.type, 
                                LogType.Location.type, 
                                LogType.Navigation.type, 
                                "Deliveries")
                    )

To access logger of these types simply call:

    val locationsLog = PLog.getLoggerFor(LogType.Location.type)
    locationsLog?.appendToFile("My Log Data!")
    
    val deliveriesLog = PLog.getLoggerFor("Deliveries")
    deliveriesLog?.overwriteToFile("My Log Data!")