cable_stackdriver 0.1.1 copy "cable_stackdriver: ^0.1.1" to clipboard
cable_stackdriver: ^0.1.1 copied to clipboard

Dart 1 only

Cable for Stackdriver (Google Cloud Logging)

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:

dependencies:
  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

  • https://www.googleapis.com/auth/logging.write

...you 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>(
    jsonConfig,
    logName: 'projects/${jsonConfig['project_id']}/logs/example',
  );
  final logger = new Logger(
    destinations: [
      // Also write to console.
      stackdriver,
    ],
  );

  // 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;
  logger.close();
}

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
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Cable for Stackdriver (Google Cloud Logging)

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

cable, googleapis, googleapis_auth, http, meta

More

Packages that depend on cable_stackdriver