cable_stackdriver 0.1.1

  • Readme
  • Changelog
  • Installing
  • 0

cable_stackdriver #

Build Status Pub Package Version Latest Dartdocs

A Google Stackdriver logging plugin for the cable logging framework.

Installation #

Add cable_stackdriver in your [pubspec.yaml][pubspec] file:

  cable_stackdriver: ^0.1.0

And that's it! See usage for details.

Usage #

You can use Stackdriver on the server with a Google Cloud service account.

Once you have a <key>.json file, with the scope

  • can create a Stackdriver object:

import 'dart:async';

import 'package:cable_stackdriver/cable_stackdriver.dart';

Future<Null> main() async {
  final jsonConfig = loadJsonFile();
  final stackdriver = await Stackdriver.serviceAccount<String>(
    logName: 'projects/${jsonConfig['project_id']}/logs/example',
  final logger = new Logger(
    destinations: [
      // Also write to console.

  // You can now use the logger.
  logger.log('Hello World', severity: Severity.warning);

  // Wait until there are no more pending messages being written.
  await stackdriver.onIdle;

Contributing #

We welcome a diverse set of contributions, including, but not limited to:

For the stability of the API and existing users, consider opening an issue first before implementing a large new feature or breaking an API. For smaller changes (like documentation, minor bug fixes), just send a pull request.

Testing #

All pull requests are validated against travis, and must pass.

Ensure code passes all our analyzer checks:

$ dartanalyzer .

Ensure all code is formatted with the latest dev-channel SDK.

$ dartfmt -w .

Run all of our unit tests (IN PROGRESS):

$ pub run test

0.1.1 #

  • Added a logName parameter, which is @required to use Stackdriver. Before we used, but that was both awkward and not technically correct.

  • Log entries are buffered, and messages collected within a second are sent together. It is possible to change (or disable) this feature by setting the buffer duration.

0.1.0 #

  • Initial release.

Use this package as a library

1. Depend on it

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

  cable_stackdriver: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:cable_stackdriver/cable_stackdriver.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.25.0-dev <2.0.0