Skip to content

nkitan/crabfull

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crabfull: Streaming Log Viewer

Crabfull is a powerful desktop application built with Rust, using the eframe and egui libraries, for real-time log file viewing. It continuously streams and displays the contents of a log file (log.txt) in a scrollable, code-friendly UI with advanced search capabilities.

Features

Core Features

  • Live Log Streaming: Automatically updates the UI as new lines are appended to log.txt
  • Modern GUI: Built with egui for a clean, responsive interface
  • Threaded File Watching: Uses a background thread to monitor the log file for changes

Search Capabilities

  • Real-time Search:
    • Instant text search with match highlighting
    • Regular expression support with easy toggle
    • Smart partial-text highlighting (only matched portions are highlighted)
    • Red dot indicators for lines containing matches
    • Match counter showing total matches found
  • Search Navigation:
    • Quick navigation between matches with ⬆⬇ buttons
    • Auto-scroll to matches when navigating
    • Maintains search state while scrolling

Navigation Controls

  • Line Navigation:
    • Jump to specific line number with Enter key support
    • Quick jump buttons for ±100, ±1K, ±10K lines
    • One-click bottom jump with auto-scroll disable
    • Smooth mouse wheel scrolling
    • Auto-scroll to latest content (can be toggled)

Performance Features

  • Efficient Memory Usage:
    • Circular buffer for memory-efficient log viewing
    • Windowed line display for handling large files
    • Smart partial file loading
    • Optimized search highlighting

UI Features

  • Clean Interface:
    • Monospace formatting for better readability
    • Clear line numbers with separator
    • Responsive layout adapting to window size
    • Consistent spacing and alignment

Control Features

  • File Reading:
    • Pause/Resume log file reading
    • Visual pause state indicator
    • Background file monitoring
  • Display:
    • Line numbers display with separator
    • Match indicators
    • Status information display
    • Monospace formatting for better readability

Usage

  1. Build and Run

    # Run with default options (log.txt file and 1M line buffer)
    cargo run --release
    
    # Run with custom log file
    cargo run --release -- mylog.log
    
    # Run with custom buffer size (500K lines)
    cargo run --release -- --buffer-size 500000 mylog.log
    
    # Display help
    cargo run --release -- --help
  2. Log File

    • By default, the application reads from log.txt in the current directory
    • You can specify a different log file as a command line argument
    • If the specified log file does not exist, it will be created automatically
    • Any new lines appended to the log file will appear in the viewer in near real-time
  3. Command Line Options

    Usage: crabfull [OPTIONS] [LOG_FILE]
    
    Arguments:
      [LOG_FILE]  Path to the log file to monitor [default: log.txt]
    
    Options:
      -b, --buffer-size <SIZE>  Number of lines to keep in memory [default: 1000000]
      -h, --help               Print help
      -V, --version            Print version
    
  4. Basic Controls

    • Use the search box to find text in logs
    • Toggle "Regex" for pattern matching
    • Navigate between matches with ⬆⬇ buttons
    • Use jump controls to move through the log file
    • Enter a line number to jump to specific location
    • Click "Pause Reading" to temporarily stop updating
  5. Customizing

    • To view a different log file, modify the log_path variable in src/main.rs

Dependencies

  • eframe - egui framework
  • egui - Immediate mode GUI
  • notify - File system notifications
  • regex - Regular expression support

Project Structure

  • src/main.rs — Main application logic and UI
  • log.txt — The log file being monitored
  • Cargo.toml — Project manifest and dependencies

License

MIT or Apache-2.0 (see Rust licensing)


Made with Rust and egui for fast, native log monitoring

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published