Git Product home page Git Product logo

cwlogs's Introduction

cwlogs

Node.js stream-based access to CloudWatch Logs.

Node.js API

cwlogs

The cwlogs module

Examples

var cwlogs = require('cwlogs');

readable

Provide a readable stream of log events for a particular log group

Parameters

  • options object default Node.js ReadableStream options with extensions detailed below.
    • options.group string the name of the LogGroup to read
    • options.region string the AWS region in which the LogGroup resides
    • options.pattern [string] a search string to use to filter log events
    • options.start [number] read log events after the provided time (in ms since since Jan 01 1970) (optional, default 15minutesago)
    • options.start [number] read log events until the provided time (in ms since since Jan 01 1970) (optional, default now)
    • options.messages [boolean] if set to true, the stream will be in objectMode: false and will provide only log event messages (optional, default false)
    • options.retry [function] a function to handle retry events from AWS requests

Examples

var readable = cwlogs.readable({
  group: '/aws/lambda/my-lambda-function-name',
  region: 'us-east-1',
  messages: true,
  start: 1464984431610,
  end: 1464985321508,
  pattern: 'error'
});
readable.pipe(process.stdout);

Returns object a Node.js ReadableStream

CLI tool

work-in-progress

cwlogs's People

Contributors

rclark avatar tmcw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cwlogs's Issues

CLI tests

Just to make sure that arguments are parsed properly.

option to leave stream open

An option to leave the stream open and continue fetching logs would be extremely useful.

This would be something like awslogs's --watch option.

--tail option

Would it be possible to write a --tail kind of option into the CLI?

Engineering Standards Adherence

Required Elements

If any elements in the below list are not checked, this repo will fail standards compliance.

  • Not running node 4 or below
  • Has at least some test coverage?
  • Has a README?

Rubric

  • 1 pt Is in Version Control/Github โœ… (free points)
  • 1-2 pt node version:
    • 2 pt Best: running node 8+ ๐Ÿ…
    • 1 pt Questionable: node 6
  • 1 pt CI enabled for repo?
  • 1 pt Not running Circle CI version 1? (Point awarded if using Travis)
  • 1 pt nyc integrated to show test coverage summary?
  • 1-3 pt test coverage percentage from nyc?
    • 3 pt High coverage: > 90%
    • 2 pt Moderate coverage: between 75 and 90% total coverage
    • 1 pt 0 - 74% test coverage
  • 1-2 pt evidence of bug fixes/edge cases being tested?
    • 2 pt Strong evidence/several instances noted
    • 1 pt Some evidence - I had a hard time deciding this one
  • 1 pt no flags to enable different functionality in non-test environments?
  • 1 pt Has README?
  • 1 pt Has CHANGELOG?
  • 1-2 pt README explains purpose of a project and how it works to some detail?
    • 2 pt High (but appropriate) amount of detail about the project
    • 1 pt Some detail about the project documented, could be more extensive
  • 1 pt README contains deploy/publish/install instructions?
  • 1 pt README contains CI badges, as appropriate?
  • 1-2 pt Code seems self-documenting: file/module names, function names, variables? No redundant comments to explain naming conventions?
    • 2 pt Strongly self-documented code, little to no improvements needed
    • 1 pt Some evidence of self-documenting code
  • 1 pt No potential security vulnerabilities are reported in dependencies?
  • 1 pt Package is scoped to @mapbox on NPM?
  • 1-2 pt master branch protected?
    • 1 pt PRs can only be merged if tests are passing?
    • 1 pt PRs must be approved before merging?
  • 2 pt BONUS: was this repo covered in a deep dive at some point?

Total possible: 24 points (+2 bonus)
Grading scale:

Point Total Qualitative Description Scaled Grade
20+ points Strongly adheres to eng. standards 5
16-19 points Adheres to eng. standards fairly well 4
12-15 points Adheres to some eng. standards 3
8-11 points Starting to adhere to some eng. standards 2
4-7 points Following a limited number of eng. standard practices 1
< 4 points Needs significant work, does not follow most standards 0

Repo grade: 18/24. Grade 4 (2018-08-08)

cc/ @mapbox/sreious-business

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.