Giter VIP home page Giter VIP logo

panicui's Introduction

panicui

panicui icon

Description

panicui provides a simple solution to easier debugging by utilizing user interface.

panicui allows you to create panic hooks that open a crash log window in just 7 lines of code.

panicui UI preview

Why use panicui?

1. Extremely lightweight

Binary size of the program shown above (no strip, with debug symbols): ~1,010KB (0.98MB)

2. Fast build times

panicui only uses one direct dependency, fltk-rs.

3. Portable across every platform

panicui uses fltk for UI, which works across practically every platform. This includes:

  • UNIX
  • Linux (X11)
  • Windows
  • MacOS X

Example usage

More examples are available in the examples folder.

#![windows_subsystem = "windows"]

use panicui::app::PanicApplication;
use panicui::style::Style;
use panicui::window::PanicWindow;
use std::backtrace::Backtrace;
use std::panic;
use std::panic::PanicInfo;

fn panic_hook(info: &PanicInfo) {
    let backtrace = Backtrace::force_capture();
    let crash_text = format!("{info}\n{backtrace}");

    let win = PanicWindow::new(Style::default(), crash_text);

    let mut app = PanicApplication::new(win);
    app.run().expect("Unable to run application.");
}

fn main() {
    panic::set_hook(Box::new(panic_hook));

    // Cause some random panic.
    Result::<(), _>::Err(5i32).unwrap();
}

panicui's People

Contributors

zofiaclient avatar

Stargazers

 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.