insightops_dart 0.0.6

  • Readme
  • Changelog
  • Example
  • Installing
  • new62

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

This package is using logging package to do the actual logging, and implements a handler to post the message to insightOps.

Setting up #

Set up a new log by following the instructions, copy a URL that you will use to send your log data to.

Usage #

A simple usage example:

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

main() {
  // Create handler and pass the URL from log settings.
  final handler = InsightOpsLogger('__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.
  logger.info('test message');

  // Log errors with stacktrace.
  try {
    throw Error();
  } catch (e, stackTrace) {
    logger.severe('Test failure', e, stackTrace);
  }
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.0.6 #

  • ⚡ Change MetaGetter to return Future

0.0.5 #

  • 📺 Update Dart dependency

0.0.4 #

  • 🐛 Fix timeout increasing

0.0.3 #

  • ⚡ Add max timeout for backoff

0.0.2 #

  • ⚡ Add error catching and exponential backoff

0.0.1 #

  • Initial version

example/insightops_dart_example.dart

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

main() {
  // Create handler and pass the URL from log settings.
  final handler = InsightOpsLogger('__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.
  logger.info('test message');

  // Log errors with stacktrace.
  try {
    throw Error();
  } catch (e, stackTrace) {
    logger.severe('Test failure', e, stackTrace);
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  insightops_dart: ^0.0.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:insightops_dart/insightops_dart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:insightops_dart/insightops_dart.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
async ^2.3.0 2.4.0
http ^0.12.0+2 0.12.0+2
logging ^0.11.3+2 0.11.3+2
Transitive dependencies
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.7
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.8.0 1.8.0+1
test ^1.6.0