insightops_dart 0.2.0
insightops_dart: ^0.2.0 copied to clipboard

Unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart.

example/insightops_dart_example.dart

import 'package:insightops_dart/insightops_dart.dart';
import 'package:logging/logging.dart';

void main() {
  // Create handler and pass the URL from log settings.
  final handler = InsightOpsLogger(Uri.parse('__LOG_URL__'));

  // Define settings for the logger.
  Logger.root.level = Level.ALL;
  Logger.root.onRecord.listen(handler);

  // Create logger.
  final logger = Logger('Test logger');

  // Log info message.
  // ignore: cascade_invocations
  logger.info('test message');

  // Log errors with stacktrace.
  try {
    throw Error();
  } catch (e, stackTrace) {
    logger.severe('Test failure', e, stackTrace);
  }
}
1
likes
130
pub points
35%
popularity

Publisher

ookamikb.dev

Unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

Dependencies

async, http, logging

More

Packages that depend on insightops_dart