MCPcopy Index your code
hub / github.com/busimus/cutelog

github.com/busimus/cutelog @2.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.2.0 ↗ · + Follow
371 symbols 992 edges 17 files 6 documented · 2% updated 2y ago2.2.0 · 2023-06-20★ 49512 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

cutelog – GUI for logging

PyPi

This is a graphical log viewer for Python's logging module. It can be targeted with a SocketHandler with no additional setup (see Usage).

It can also be used from other languages or logging libraries with little effort (see the Wiki). For example, a Go library gocutelog shows how to enable regular Go logging libraries to connect to cutelog.

Features

  • Allows any number of simultaneous connections
  • Customizable look of log levels and columns, with presets for each
  • Filtering based on level and namespace, as well as filtering by searching
  • Search through all records or only through filtered ones
  • Display extra fields under the message with Extra mode
  • View exception tracebacks or messages in a separate window
  • Dark theme (with its own set of colors for levels)
  • Pop tabs out of the window, merge records of multiple tabs into one
  • Save/load records to/from a file in JSON format

Screenshots

Light theme Dark theme

Installation

If you're using Linux, install PyQt5 (or PySide2) from your package manager before installing cutelog (package name is probably python3-pyqt5 or python-pyqt5). Or just run pip install pyqt5 to install it from pip, which is sub-optimal.

$ pip install cutelog

Or install the latest development version from the source (requires PyQt5 to build resources):

$ pip install git+https://github.com/busimus/cutelog.git

Requirements

  • Python 3.5 (or newer)
  • PyQt5 (preferably 5.6 or newer) or PySide2
  • QtPy

Usage

  1. Start cutelog
  2. Put the following into your code:
import logging
from logging.handlers import SocketHandler

log = logging.getLogger('Root logger')
log.setLevel(1)  # to send all records to cutelog
socket_handler = SocketHandler('127.0.0.1', 19996)  # default listening address
log.addHandler(socket_handler)
log.info('Hello world!')

Afterwards it's recommended to designate different loggers for different parts of your program with log_2 = log.getChild("Child logger"). This will create "log namespaces" which allow you to filter out messages from various subsystems of your program.

Attributions

Free software used: * Qt via either: * PyQt5 - GPLv3 License, Copyright (c) 2019 Riverbank Computing Limited info@riverbankcomputing.com * PySide2 - LGPLv3 License, Copyright (C) 2015 The Qt Company Ltd (http://www.qt.io/licensing/) * QtPy - MIT License, Copyright (c) 2011- QtPy contributors and others * jsonstream - MIT License, Copyright (c) 2020 Dunes * ion-icons - MIT License, Copyright (c) 2015-present Ionic (http://ionic.io/)

And thanks to logview by Vinay Sajip for UI inspiration.

Copyright and license

This program is released under the MIT License (see LICENSE file).

Copyright © 2023 bus and contributors.

Core symbols most depended-on inside this repo

current_logger_and_index
called by 13
cutelog/main_window.py
clear
called by 8
cutelog/logger_tab.py
update_output
called by 7
cutelog/logger_table_header.py
show_warning_dialog
called by 6
cutelog/utils.py
invalidate_filter
called by 6
cutelog/logger_tab.py
update_output
called by 6
cutelog/level_edit_dialog.py
update_output
called by 6
cutelog/levels_preset_dialog.py
set_status
called by 5
cutelog/main_window.py

Shape

Method 323
Class 35
Function 13

Languages

Python100%

Modules by API surface

cutelog/logger_tab.py106 symbols
cutelog/main_window.py65 symbols
cutelog/logger_table_header.py39 symbols
cutelog/config.py36 symbols
cutelog/listener.py21 symbols
cutelog/level_edit_dialog.py20 symbols
cutelog/levels_preset_dialog.py18 symbols
cutelog/settings_dialog.py16 symbols
cutelog/log_levels.py13 symbols
cutelog/merge_dialog.py11 symbols
cutelog/utils.py7 symbols
cutelog/pop_in_dialog.py6 symbols

For agents

$ claude mcp add cutelog \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page