oleq_logs 0.0.9
oleq_logs: ^0.0.9 copied to clipboard
Oleq Logs Flutter/Dart SDK — structured logging to the Oleq ingest API.
example/main.dart
// Minimal oleq_logs usage. Set OLEQLOG_API_KEY (or pass apiKey) before run:
// dart run example/main.dart
// flutter run -t example/main.dart --dart-define=OLEQLOG_API_KEY=sk_live_…
import 'package:oleq_logs/oleq_logs.dart';
Future<void> main() async {
final log = OleqLog(const LoggerConfig(
appName: 'example-app',
environment: 'development',
// apiKey: 'sk_live_…', // or OLEQLOG_API_KEY / --dart-define
sensitive: SensitiveConfig(
fields: ['password', 'authorization'],
action: SensitiveAction.redact,
),
));
await log.info(const LogPayload(message: 'screen opened'));
await log.warn(const LogPayload(
message: 'slow query',
body: {'ms': 420},
));
await log.error(const LogPayload(
message: 'checkout failed',
kind: LogKind.res,
importance: Importance.high,
body: {'status': 402, 'password': 'secret'},
));
await log.flush();
await log.close();
}