Giter Club home page Giter Club logo

journalctl-mode's Introduction

journalctl-mode.el

Introduction

This Emacs major mode is designed for viewing the output from systemd’s journalctl within Emacs. It provides a convenient way to interact with journalctl logs, including features like fontification, chunked loading for performance, and custom keyword highlighting.

journalctl.v1.1.gif

Installation

To install, place journalctl-mode.el in your load-path and add the following to your .emacs file:

(require 'journalctl-mode)

Alternatively, you can install journalctl-mode using the use-package macro with Quelpa for automatic installation from the GitHub repository:

(use-package journalctl-mode
  :ensure t)

Define a global key

It might be a good idea to define a global key to journalctl with:

(global-set-key (kbd "C-c t") 'journalctl)

or with use-package:

(use-package journalctl-mode
  :ensure t
  :bind (("C-c t" . journalctl)))

Features

  • Fontification: Customize the appearance of log levels with faces.
  • Chunked Loading: Load journalctl output in manageable chunks for better performance.
  • Keyword Highlighting: Define custom keywords for error, warning, and other log levels.
  • Follow Mode: Simulate tail -f functionality to keep up with new log entries.

Usage

Once installed, journalctl-mode can be invoked with M-x journalctl. The mode provides a transient interface for journalctl command-line options, allowing for dynamic and flexible log viewing.

Customization

Customize the mode to your liking by setting the following variables:

  • journalctl-chunk-size: Number of lines per chunk (default 250).
  • journalctl-error-keywords: List of keywords to highlight as errors.
  • journalctl-warn-keywords: List of keywords to highlight as warnings.
  • journalctl-starting-keywords: Keywords for starting processes.
  • journalctl-finished-keywords: Keywords for finished processes.
  • journalctl-follow-freq: Frequency for updating in follow mode.
  • journalctl-follow-lines: Number of lines to show in follow mode.
  • journalctl-default-options: List of default options for journalctl on start.

Key Bindings

KeyAction
nLoad next chunk of journalctl output
pLoad previous chunk of journalctl output
C-vScroll up in the buffer
M-vScroll down in the buffer
qQuit journalctl mode

Other Packages

There is another package journalctl (rather than journalctl-mode) by James Ferguson that fetches and interleaves JSON data using multiple simultaneous asynchronous journalctl queries, while mine offers a UI for query-building and chunked synchronous data loading.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Support

For support, feedback, or to contribute to the project, please visit the homepage at https://github.com/SebastianMeisel/journalctl-mode.

Acknowledgements

Thanks to all contributors and users for their support and feedback which continue to improve this mode.

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.