GithubHelp home page GithubHelp logo

yapt's Introduction

yapt - Yet Another Python tail'er

Yet Another Python tail'er is a small python-script for continuos colorization of your log-files.

YAPt aims to be:

  • Working like tail -f.
  • Simple.
  • Lightweight.
  • Easily modified to custom needs.

Features:

  • Colorizes lines starting with INFO, WARNING and ERROR.
  • Wrap lines at column 80 and indent those.
  • Write tagged HTML to a file.

Usage

$ ./yapt some.log
INFO: Here is some info in green.
WARNING: Here is a warning in yellow.
ERROR: This is an error in red.
^C
$ ./yapt some.log -o colored.html

The last command switches from printing the log to std-out, to writing tagged-html to colored.html. Included is an example-file, serve_log.html, utilizing AJAX to dynamicly updating a view of colored.html.

For help:

$ ./yapt -h
usage: yapt.py [-h] [-o file] file

A colorized version of 'tail -f'

positional arguments:
  file                  The file to tail.

optional arguments:
  -h, --help            show this help message and exit
  -o file, --outfile file
                        If specified, writes tagged HTML to outfile, ready for
                        serving.

Try it

Execute test_writer.py in a shell:

$ ./test_writer.py
...

Then in another shell:

$ ./yapt.py access.log
...

This will print out a colored indented version of access.log. Executing

$ ./yapt.py access.log -o colored.log

will save tagged html into colored.log. To see this, execute this in another shell

$ python -m SimpleHTTPServer

to start serving requests. Then access the example at http://0.0.0.0:8000/serve_log.html.

yapt's People

Contributors

doerge avatar

Watchers

 avatar  avatar  avatar

yapt'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.