2023-05-27 01:06:18 +07:00
|
|
|
// ignore_for_file: non_constant_identifier_names
|
|
|
|
|
|
|
|
import 'package:vlogs/vlogs.dart';
|
|
|
|
|
|
|
|
void main() async {
|
|
|
|
final APP_ID = "72bd14c306a91fa8a590330e3898ddcc";
|
|
|
|
final API_KEY = "vlogs_gX9WwSdKatMNdpUClLU0IfCx575tvdoeQ";
|
|
|
|
|
|
|
|
final sdk = VLogs.create(APP_ID, API_KEY);
|
|
|
|
|
2023-05-27 09:04:53 +07:00
|
|
|
var request = Collector.builder()
|
2023-05-27 01:06:18 +07:00
|
|
|
.message("Hello World")
|
|
|
|
.source(CollectorSource.mobile.name)
|
|
|
|
.type(CollectorType.log.name)
|
|
|
|
.build();
|
|
|
|
|
2023-05-27 09:04:53 +07:00
|
|
|
// Run this to test non-blocking collect
|
|
|
|
sdk.collectAsync(request);
|
|
|
|
|
|
|
|
// Run this to test blocking collect
|
2023-05-27 01:06:18 +07:00
|
|
|
var response = await sdk.collect(request);
|
2023-05-27 09:04:53 +07:00
|
|
|
|
|
|
|
// Output the response
|
2023-05-27 01:06:18 +07:00
|
|
|
print("Response: ${response.toJson()}");
|
|
|
|
}
|