247 lines
5.2 KiB
Markdown
247 lines
5.2 KiB
Markdown
# RLogg - Fast Log File Viewer
|
||
|
||
A fast, native log file viewer with search, filtering, and highlighting capabilities built with Rust and egui.
|
||
|
||
## Features
|
||
|
||
- **Fast Performance**: Handle large log files (GB+) with efficient line indexing
|
||
- **Advanced Search**: Regex support, case-sensitive/insensitive search, date range filtering
|
||
- **Syntax Highlighting**: Custom highlight rules with regex patterns
|
||
- **Multiple Tabs**: Open and view multiple log files simultaneously
|
||
- **Export Results**: Export filtered/searched results to new files
|
||
- **Cross-Platform**: Native builds for Linux, Windows, and macOS
|
||
- **Command-Line Interface**: Open files directly from terminal or OS file associations
|
||
|
||
## Installation
|
||
|
||
### From Source
|
||
|
||
1. **Clone the repository:**
|
||
```bash
|
||
git clone https://github.com/yourusername/rlogg.git
|
||
cd rlogg
|
||
```
|
||
|
||
2. **Build in release mode:**
|
||
```bash
|
||
cargo build --release
|
||
```
|
||
|
||
3. **The binary will be available at:**
|
||
```
|
||
target/release/rlogg
|
||
```
|
||
|
||
### Linux
|
||
|
||
#### Quick Install (User-Local)
|
||
|
||
```bash
|
||
cargo build --release
|
||
cd packaging/linux
|
||
./install.sh
|
||
```
|
||
|
||
This will:
|
||
- Install `rlogg` to `~/.local/bin/`
|
||
- Set up file associations for `.log` files
|
||
- Configure desktop integration
|
||
|
||
Make sure `~/.local/bin` is in your PATH:
|
||
```bash
|
||
export PATH="$HOME/.local/bin:$PATH"
|
||
```
|
||
|
||
#### System-Wide Install
|
||
|
||
```bash
|
||
sudo cp target/release/rlogg /usr/local/bin/
|
||
sudo cp packaging/linux/rlogg.desktop /usr/share/applications/
|
||
sudo cp packaging/linux/text-x-log.xml /usr/share/mime/packages/
|
||
sudo update-desktop-database /usr/share/applications
|
||
sudo update-mime-database /usr/share/mime
|
||
```
|
||
|
||
### Windows
|
||
|
||
1. **Build the project:**
|
||
```powershell
|
||
cargo build --release
|
||
```
|
||
|
||
2. **Run the installation script:**
|
||
```powershell
|
||
cd packaging\windows
|
||
powershell -ExecutionPolicy Bypass -File install.ps1
|
||
```
|
||
|
||
This will:
|
||
- Install RLogg to `%LOCALAPPDATA%\Programs\RLogg`
|
||
- Create file associations for `.log` files
|
||
- Add "Open with RLogg" to the context menu
|
||
|
||
## Usage
|
||
|
||
### Graphical Interface
|
||
|
||
**Launch without arguments:**
|
||
```bash
|
||
rlogg
|
||
```
|
||
|
||
Then use the "Open File" button to select log files.
|
||
|
||
### Command-Line Interface
|
||
|
||
**Open a single file:**
|
||
```bash
|
||
rlogg /path/to/file.log
|
||
```
|
||
|
||
**Open multiple files (each in a separate tab):**
|
||
```bash
|
||
rlogg file1.log file2.log file3.log
|
||
```
|
||
|
||
**Open all log files in a directory:**
|
||
```bash
|
||
rlogg /var/log/*.log
|
||
```
|
||
|
||
**Get help:**
|
||
```bash
|
||
rlogg --help
|
||
```
|
||
|
||
**Check version:**
|
||
```bash
|
||
rlogg --version
|
||
```
|
||
|
||
### File Associations
|
||
|
||
After installation, you can:
|
||
- **Double-click** `.log` files to open them in RLogg
|
||
- **Right-click** → "Open With" → RLogg
|
||
- **Drag and drop** multiple log files onto the RLogg icon
|
||
|
||
See [docs/FILE_ASSOCIATIONS.md](docs/FILE_ASSOCIATIONS.md) for detailed setup and troubleshooting.
|
||
|
||
## Features Guide
|
||
|
||
### Search
|
||
|
||
1. Enter search query in the search panel
|
||
2. Choose case-sensitive or regex mode
|
||
3. Optionally enable date range filtering
|
||
4. Results are highlighted and filtered in real-time
|
||
|
||
### Highlighting
|
||
|
||
1. Click "Highlight Rules" to open the editor
|
||
2. Add custom regex patterns with colors
|
||
3. Rules are applied to all open files
|
||
4. Perfect for highlighting errors, warnings, etc.
|
||
|
||
### Tabs
|
||
|
||
- Open multiple files simultaneously
|
||
- Each file maintains its own search/filter state
|
||
- Close tabs with the × button
|
||
- Switch between tabs with mouse or keyboard
|
||
|
||
### Export
|
||
|
||
- Export filtered/searched results to a new file
|
||
- Preserves line formatting
|
||
- Useful for extracting specific log entries
|
||
|
||
## Building
|
||
|
||
### Prerequisites
|
||
|
||
- Rust 1.70 or later
|
||
- Cargo
|
||
|
||
### Build Commands
|
||
|
||
**Development build:**
|
||
```bash
|
||
cargo build
|
||
```
|
||
|
||
**Release build (optimized):**
|
||
```bash
|
||
cargo build --release
|
||
```
|
||
|
||
**Run directly:**
|
||
```bash
|
||
cargo run -- /path/to/file.log
|
||
```
|
||
|
||
**Run tests:**
|
||
```bash
|
||
cargo test
|
||
```
|
||
|
||
See [BUILD.md](BUILD.md) for detailed build instructions.
|
||
|
||
## Packaging
|
||
|
||
See [packaging/README.md](packaging/README.md) for instructions on creating distribution packages:
|
||
- Linux: `.deb`, `.rpm`, AppImage, tarballs
|
||
- Windows: Installers, ZIP archives
|
||
|
||
## Configuration
|
||
|
||
RLogg stores configuration in `rlogg_config.json` next to the executable:
|
||
- Search history
|
||
- Highlight rules
|
||
- UI preferences
|
||
- Date format settings
|
||
|
||
## Troubleshooting
|
||
|
||
### Linux
|
||
|
||
**File associations not working:**
|
||
```bash
|
||
update-desktop-database ~/.local/share/applications
|
||
update-mime-database ~/.local/share/mime
|
||
```
|
||
|
||
**Binary not found:**
|
||
Ensure `~/.local/bin` is in your PATH.
|
||
|
||
### Windows
|
||
|
||
**File associations not working:**
|
||
1. Restart File Explorer
|
||
2. Check registry entries (see [docs/FILE_ASSOCIATIONS.md](docs/FILE_ASSOCIATIONS.md))
|
||
|
||
**Permission errors:**
|
||
Run PowerShell as Administrator or install to user directory.
|
||
|
||
For more troubleshooting, see [docs/FILE_ASSOCIATIONS.md](docs/FILE_ASSOCIATIONS.md).
|
||
|
||
## Contributing
|
||
|
||
Contributions are welcome! Please:
|
||
1. Fork the repository
|
||
2. Create a feature branch
|
||
3. Make your changes
|
||
4. Run tests and formatting
|
||
5. Submit a pull request
|
||
|
||
## License
|
||
|
||
MIT OR Apache-2.0
|
||
|
||
## Acknowledgments
|
||
|
||
Built with:
|
||
- [eframe](https://github.com/emilk/egui/tree/master/crates/eframe) - GUI framework
|
||
- [egui](https://github.com/emilk/egui) - Immediate mode GUI library
|
||
- [rfd](https://github.com/PolyMeilex/rfd) - Native file dialogs
|
||
- [clap](https://github.com/clap-rs/clap) - Command-line argument parsing |