Git Product home page Git Product logo

stream_logger's Introduction

stream_logger

This program will log stdin/stdout/stderr of a process. This might be useful for debugging purposes. stream_logger tries to propagate all stdin/stderr/stdout, as is the exit code.

Usage

$ ./stream_logger --help
Run and log process.

stream_logger [--name_prefix PREFIX] -- PROGRAM [ARG ...]

Generic options:
  --help                   Output this help message
  --name_prefix arg (=log) Output name prefix

Example

$ cat << EOF | ./stream_logger -- m4
define(a,4)dnl
a
EOF

will print:

4

to the stdout.

Furthermore, log_args_000, log_stdin_000, log_stdout_000 and log_stderr_000 will be created.

Pitfalls

Some programs will not finish immediately when calling its exit function. e.g. Python will continue parsing stdin until EOF.

$ cat << EOF | ./stream_logger -- python
print(4)
import sys
sys.exit(3)
# Code after sys.exit will be parsed as well, but not executed
print(40)
EOF

Build requirements

  • C++14 compiler
  • Boost (asio, process, program_options)

stream_logger's People

Contributors

madebr avatar

Watchers

James Cloos avatar  avatar

stream_logger's Issues

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.