
Facilitates logging and storing log files on Firebase with functions for console logging, file logging, and Firebase uploads. Includes platform-specific configurations for initialization.
This repository facilitates logging and storing the generated log file on Firebase. We use Kotlin Multiplatform library that is deployable to Maven Central.
The library has the following functions. Also, it has a test for each platform just to be sure that tests run.
This repository's forked from the Kotlin Multiplatform Library Template.
The repository supports the following platforms:
| Platforms | |
|---|---|
| Android | Yes |
| iOS | Yes |
| Java | No |
| Linux | No |
| Windows | No |
ou can download the library from Maven Central repository at https://central.sonatype.com/search?q=io.github.hesamedin. Make sure to get the right build for your platform.
To use this library, you need to initialize it with platform-specific configurations, particularly for setting up the log file directory.
The library requires the Android Context to determine a suitable directory (e.g., cache directory) for storing log files. You should initialize the library, typically in your Application class or using a dependency injection framework, by providing a path provider function.
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
// Simply call the initializer
AndroidLoggerInitializer.init(this)
// Now you can use the logger
MultiplatformLogger.log("MyApplication: Logger has been initialized.")
}
}Update the AppDelegate to initialize the logger with a directory path for storing log files. This is typically done in the application:didFinishLaunchingWithOptions: method.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Simply call the initializer
MPLoggerIOSInitializer.init()
// Now you can use the logger
MultiplatformLogger.log("MyApplication: Logger has been initialized.")
}
}TBD
This repository facilitates logging and storing the generated log file on Firebase. We use Kotlin Multiplatform library that is deployable to Maven Central.
The library has the following functions. Also, it has a test for each platform just to be sure that tests run.
This repository's forked from the Kotlin Multiplatform Library Template.
The repository supports the following platforms:
| Platforms | |
|---|---|
| Android | Yes |
| iOS | Yes |
| Java | No |
| Linux | No |
| Windows | No |
ou can download the library from Maven Central repository at https://central.sonatype.com/search?q=io.github.hesamedin. Make sure to get the right build for your platform.
To use this library, you need to initialize it with platform-specific configurations, particularly for setting up the log file directory.
The library requires the Android Context to determine a suitable directory (e.g., cache directory) for storing log files. You should initialize the library, typically in your Application class or using a dependency injection framework, by providing a path provider function.
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
// Simply call the initializer
AndroidLoggerInitializer.init(this)
// Now you can use the logger
MultiplatformLogger.log("MyApplication: Logger has been initialized.")
}
}Update the AppDelegate to initialize the logger with a directory path for storing log files. This is typically done in the application:didFinishLaunchingWithOptions: method.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Simply call the initializer
MPLoggerIOSInitializer.init()
// Now you can use the logger
MultiplatformLogger.log("MyApplication: Logger has been initialized.")
}
}TBD