Coder Social home page Coder Social logo

hellosaumil / myerrvisualizer Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 3.64 MB

MyErrVisualizer is an utility to better showcase a Traceback generated from Errors while running a Python File

Home Page: https://my-err-visualizer.herokuapp.com

Python 54.74% CSS 5.58% JavaScript 0.63% HTML 39.05%
python error-monitoring error-handling visualization error-visualization utility utility-function python-utility

myerrvisualizer's Introduction

MyErrVisualizer

MyErrVisualizer is an utility to better showcase a Traceback generated from Errors while running a Python File!

For Web Version:

Live: MyErrVisualizer on Heroku

For CLI:

Download just ONE file! - myErrVisualizer.py


Man Page like Description

Name

myErrVisualizer - MyErrVisualizer is an utility to better showcase a Traceback generated from Errors while running a Python File

Synopsis

myErrVisualizer ERROR_FILE_PATH... [NUM_CALLS]...

Description

A Simple Command-Line Utility to Visualize your Python Errors

It is often time-consuming for me to go through python error traceback calls to figure which file, which function and which line has the error. Also, the error statement is buried deep down in those traces which is hard to read. I attempt in this utility to increase the readability of python error logs.

Note: Use of NUM_CALLS is only supported for standard error logs and not unenven logs, See Caveats to understand the differnce.

Showcase

Comparision: MyErrVisualizer v/s Typical Python Error

MyErrVisualizer2 myErrVisualizer in a Terminal Window

MyErrVisualizer2 Typical Python Error shown in a Terminal Window

Comparision: MyErrVisualizer v/s Typical Python Error in Jupyter Notebook Logs

MyErrVisualizer1 myErrVisualizer in a Terminal Window

MyErrVisualizer1 Typical Python Error shown in a Terminal Window


With Options like num_calls to show only First and Last n Calls. (Here, n=3)

MyErrVisualizer1

Options

Describes all Options of myErrVisualizer
-f		Provide the Error File Name that contains
        Python Error Traceback Calls After -f or --err_file_path option
--err_file_path		 

-n		Number of Error Calls to be printed, default=None
        (only works with standard error tracesback calls)
--num_calls		 


-h		Shows Usage Help
--help

Usage

When creating a error file of the traceback calls, include logs starting from the line that states Traceback (most recent call last): to SomeError: Error Message that is displayed

python myErrVisualizer.py                			# Displays Help Page
python myErrVisualizer.py   -f   error_file.err			# Provide an error file
python myErrVisualizer.py   -f   error_file.err   -n   3	# Provide number of calls to showcase, default=None

alternatively,

python myErrVisualizer.py   --err_file_path   error_file.err
python myErrVisualizer.py   --err_file_path   error_file.err   --num_calls   3

Caveats

Standard Traceback Calls:

Traceback (most recent call last):
  File "sample_file.py", line 274, in <module>
    generate_image(iteration, netG)
  File "sample_file.py", line 138, in generate_image
    test_dir + '/samples_{}.png'.format(frame)
  File "/home/user/repo/codes/folder1/folder2/sample_file2.py", line 31, in save_images
    img = np.zeros((h*nh, w*nw))
TypeError: 'float' object cannot be interpreted as an integer

i.e., Each line starting with File is followed by a code with referencing(tracing) back to the original error, usually a file line and code line pattern.

Unenven Traceback Calls:

Traceback (most recent call last):
  File "sample_file.py", line 274, in <module>
  File "sample_file.py", line 138, in generate_image
    test_dir + '/samples_{}.png'.format(frame)
  File "/home/user/repo/codes/folder1/folder2/sample_file2.py", line 31, in save_images
    img = np.zeros((h*nh, w*nw))
TypeError: 'float' object cannot be interpreted as an integer

i.e., Each line starting with File may not be followed by a code

Version

Beta 0.1 - Only Supports Unix Systems (i.e, macOS, OS X, Linux - Ubuntu), Supports Python 2.x and 3.x

Author

Written by Saumil Shah.
More details about this project can be found at : https://github.com/hellosaumil/MyErrVisualizer
[Download source code here!](/)

Reporintg Bugs

Report bugs to https://github.com/hellosaumil/MyErrVisualizer/issues

myerrvisualizer's People

Contributors

dependabot[bot] avatar hellosaumil avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.