GithubHelp home page GithubHelp logo

dekobon / bunyan-view Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 308 KB

Bunyan log viewer implemented in Rust

License: Mozilla Public License 2.0

Rust 84.56% Makefile 13.02% Ruby 1.10% Shell 1.32%
bunyan logging rust node-bunyan

bunyan-view's Introduction

Rust Crates.io Crates.io

Bunyan Viewer

Screenshot

This project is a rewrite of the node-bunyan bunyan format log viewer CLI tool fully reimplemented in Rust.

Bunyan Viewer aims to be a stand-alone replacement for the node bunyan tool such that it:

  • Does not require additional runtimes (such as nodejs)
  • Can handle large log files with ease
  • Processes each log line in a memory efficient manner

Divergences

We aim to provide output that is as close as possible to the node-bunyan viewer with a few intentional divergences.

Features

Bunyan Viewer supports the following features:

  • The same output modes as the node-bunyan viewer (-o, --output flag):
    • bunyan: 0 indented JSON, bunyan's native format
    • inspect: node.js util.inspect output
    • json: JSON output, 2-space indent
    • json-N: JSON output, N-space indent, e.g. "json-4"
    • long: (the default) pretty
    • short: like "long", but more concise
    • simple: level, followed by "-" and then the message`
  • Support for conditional matching (--condition flag)
  • Local time conversion (-L, --time-local flag)
  • Filtering by level (-l, --level flag)
  • Strict mode (--strict flag)
  • Optional colorization - with a few extra colors sprinkled in (--color flag)
  • Pager support (--pager flag)
  • Decompression of gzipped archives
  • Node bunyan CLI compatibility
  • Supports viewing large log files

Limitations

Bunyan Viewer does not yet support the following:

  • Runtime log snooping via DTrace (-p flag)

Installation

Install the Bunyan Viewer into your Cargo Crates enabled environment by installing the crate:

  cargo install bunyan_view

Usage

Directly viewing one or more bunyan log files:

  bunyan logs/logs-001.log logs/logs-002.log logs/big-log-003.log.gz

View logs via piped input:

  cat logs/logs-001.log | bunyan 

Alternatively:

  bunyan < logs/logs-001.log

For additional usage help:

  bunyan --help

Testing

When running the automated testing suite, be sure to enable the dumb_terminal feature so that colorization is disabled. You can do this by invoking cargo test as follows:

  cargo test --features dumb_terminal

Other Bunyan Projects

License

This project is licensed under the Mozilla Public License Version 2.0. See the LICENSE.txt file for more details.

bunyan-view's People

Contributors

dekobon avatar maximeborges avatar papertigers avatar

Watchers

 avatar  avatar

bunyan-view's Issues

Level Filter only works with default output

Thank you for this library, however I have the following issue.

The level filter is ignored on output formats other than the default. Am I doing something wrong?

  • works fine: cargo run | bunyan --level 30
  • shows all levels: cargo run | bunyan --level 30 -o inspect

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.