SmartGrowLogs class
SmartGrowLogs - Secure logging SDK for Flutter
Provides secure logging with end-to-end encryption powered by Rust native library.
Usage:
// Initialize (call once at app startup)
await SmartGrowLogs.initialize(
apiKey: 'sgl_your_api_key',
baseUrl: 'https://logs.smartgrow.com/',
);
// Send logs using convenience methods
await SmartGrowLogs.instance.error('Something went wrong', stackTrace: exception.stackTraceToString());
await SmartGrowLogs.instance.info('User logged in', metadata: '{"userId": "123"}');
Properties
- apiKey → String
-
API Key for authentication
final
- baseUrl → String
-
Base URL of the Smart Grow Logs server
final
- debug → bool
-
Enable debug logging
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
error(
String message, {String? stackTrace, String? metadata, String? userIdentifier, String? sessionId}) → Future< LogResponse> - Send an ERROR level log
-
errorWithException(
String message, Object exception, {StackTrace? stackTrace, String? metadata, String? userIdentifier, String? sessionId}) → Future< LogResponse> - Send an ERROR level log from an exception
-
fatal(
String message, {String? stackTrace, String? metadata, String? userIdentifier, String? sessionId}) → Future< LogResponse> - Send a FATAL level log
-
info(
String message, {String? metadata, String? userIdentifier, String? sessionId}) → Future< LogResponse> - Send an INFO level log
-
logDebug(
String message, {String? metadata, String? userIdentifier, String? sessionId}) → Future< LogResponse> - Send a DEBUG level log
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendLog(
LogOptions options) → Future< LogResponse> - Send a log entry with full options
-
toString(
) → String -
A string representation of this object.
inherited
-
warn(
String message, {String? metadata, String? userIdentifier, String? sessionId}) → Future< LogResponse> - Send a WARN level log
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → SmartGrowLogs
-
Get the singleton instance
Throws if not initialized
no setter
- isInitialized → bool
-
Check if SDK is initialized
no setter
Static Methods
-
initialize(
{required String apiKey, required String baseUrl, bool debug = false}) → Future< SmartGrowLogs> - Initialize the Smart Grow Logs SDK
-
resetInstance(
) → void - Reset the singleton instance (for testing only)