Git Product home page Git Product logo

pipecolor's People

Contributors

dalance avatar dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 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

Watchers

 avatar  avatar  avatar  avatar

pipecolor's Issues

Exits with "Error: stream did not contain valid UTF-8"

I've started using pipecolor with the unit-test log output from the project I work on, and it's great.

However, in one scenario the output cuts off early with the message Error: stream did not contain valid UTF-8. I made sure this only happens when piping through pipecolor, so the message is not coming from our code.

It appears that something in a test of ours is writing some binary data to the log; so pipecolor is correct that there's invalid UTF-8 in the stream. However, it should not give up when this happens; it should just write the offending line as-is and go on to the next one. Otherwise it ends up hiding information from the user.

(PS: I'm running the latest version of pipecolor, built via cargo, on macOS 12.6.5.)

Make the syntax somewhat more forgiving

  1. It would be nice if the tokens property were optional. Many of my rules don't use tokens, so I forget to add them, but currently it's a fatal error if a lines block doesn't contain a tokens property.
  2. It would be handy if there were some color synonyms, so I didn't have to remember the exact names. For example, "Gray" as a synonym for "LightBlack", or "Orange" for "Yellow".

Panic at 'index out of bounds'

Hi! Pipecolor looks like a tool that would be very useful to me, so I've decided to give it a go.

I have tried following the instructions in README.md to create a simple rule that would colourise an entire line based on a regex.

My ~/.pipecolor.toml is

[[lines]]
	pat = "^This is a test message to see if (VARIANT1|VARIANT2|ETC).*"
	colors = ["Magenta"]
	[[lines.tokens]]
		pat = ""
		colors = []

The file I'm testing it on contains these 2 lines

-- Some uninteresting message
This is a test message to see if VARIANT1 is colourised by pipecolor

Running RUST_BACKTRACE=1 pipecolor --mode always test.log results in

-- Some uninteresting message
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', /build/rust/src/rustc-1.38.0-src/src/libcore/slice/mod.rs:2715:10
stack backtrace:
   0: std::panicking::default_hook::{{closure}}
   1: std::panicking::default_hook
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::continue_panic_fmt
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::panicking::panic_bounds_check
   7: pipecolor::colorize::colorize
   8: pipecolor::output
   9: pipecolor::main
  10: std::rt::lang_start::{{closure}}
  11: std::panicking::try::do_call
  12: __rust_maybe_catch_panic
  13: std::rt::lang_start_internal
  14: main
  15: __libc_start_main
  16: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Am I doing something wrong?

error[E0432]: unresolved import `nix::poll`

error[E0432]: unresolved import `nix::poll`
  --> /usr/ports/deskutils/pipecolor/work/pipecolor-0.4.2/cargo-crates/timeout-readwrite-0.1.0/src/lib.rs:46:5
   |
46 | use nix::poll;
   |     ^^^^^^^^^ no `poll` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `timeout-readwrite` due to previous error

rust-1.66.0
OS: FreeBSD 13.1

Support default colors without pipecolor.toml config file

Hi,

Nice work! Any chance you will support single-binary releases in the future?

I would love to not have to download the pipecolor.toml file in case I don't have it (say I download the binary on a server in the cloud).
Ideally, pipecolor would have a fallback if no configuration is specified.

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.