Skip to main content

Log a line in my daily log.

Latest release 20240316: Fixed release upload artifacts.

This is an upgrade from my venerable shell script, whose logic was becoming unwieldy.

I more or less live in the shell, so I log activity with brief 1-line shell command commands eg:

dlog HOME: set up the whatchamgig

which I alias as dl, with additional aliases like HOME for dl HOME: and so forth; as short a throwaway line as I can get away with. In particular, I use this to make notes about work activity (none of the several time tracking tools I've tried work for me) and things like banking and purchases eg:

dl MYBANK,VENDOR: xfer \$99 to vendor for widget from bank acct rcpt 1234567

I've got scripts to pull out the work ones for making invoices and an assortment of other scripts (eg my alert script) also log via dlog.

The current incarnation logs to a flat text file (default ~/var/dlog-quick) and to SQLTags SQLite database. It has a little daemon mode to reduce contention for the SQLite database too.

Class DLog

A log entry.

Function dlog(headline: str, *, logpath: Optional[str] = None, sqltags: Optional[cs.sqltags.SQLTags] = '~/var/sqltags.sqlite', tags=None, categories: Optional[Iterable] = None, when: Union[NoneType, int, float, datetime.datetime] = None)

Log headline to the dlog.

Parameters:

  • headline: the log line message
  • logpath: optional text log pathname, default ~/var/log/dlog-quick from DEFAULT_LOGPATH
  • sqltags: optional SQLTags instance, default uses ~/var/sqltags.sqlite from DEFAULT_DBPATH
  • tags: optional iterable of Tags to associate with the log entry
  • categories: optional iterable of category strings
  • when: optional UNIX time or datetime, default now

Class DLogCommand(cs.cmdutils.BaseCommand)

The dlog command line implementation.

Command line usage:

Usage: dlog subcommand [...]
  Subcommands:
    daemon [pipepath]
      Listen on pipepath for new dlog messages.
      This serialises contention for the database.
    help [-l] [subcommand-names...]
      Print help for subcommands.
      This outputs the full help for the named subcommands,
      or the short help for all subcommands if no names are specified.
      -l  Long help even if no subcommand-names provided.
    log [{CATEGORIES:|tag=value}...] headline
      Log headline to the dlog.
      Options:
      -c categories   Alternate categories specification.
      -d datetime     Timestamp for the log entry instead of "now".
    scan [{-|filename}]...
      Scan log files and report.
    shell
      Run a command prompt via cmd.Cmd using this command's subcommands.

Function main(argv=None)

Run the dlog command line implementation.

Release Log

Release 20240316: Fixed release upload artifacts.

Release 20240305: Initial PyPI release.

Release files for cs.app.dlog 20240316

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cs.app.dlog 20240316
File Size Uploaded
cs.app.dlog-20240316.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cs.app.dlog 20240316
File Interpreter ABI Platform
cs.app.dlog-20240316-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / cs.app.dlog-20240316.tar.gz

Download URL cs.app.dlog-20240316.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d0ebb72623fb3223b05dc2ee6378e5441e9618636b8ce7d3f429fcc76a1c8cb3
BLAKE2b-256 checksum
How to use checksums
9aa1d8e5222e05d176269a2d509b8a0dabb888bdeef64c1318c2ee15a23d3242
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.6

Release files / cs.app.dlog-20240316-py3-none-any.whl

Download URL cs.app.dlog-20240316-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a047d7b1a7a3d3cfd169c451bc584d20f4572c6358c145e33facfaaebfef647
BLAKE2b-256 checksum
How to use checksums
8d814c4380b8fef24fa2fa592f83b1d99e58cd999ba37ad792db4ba09584213d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.6

Release history Release notifications | RSS feed

This release

20240316 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page