Skip to main content

X() is my function for low level ad hoc debug messages. It takes a message and optional format arguments for use with %. It is presented here in its own module for reuse.

It normally writes directly to sys.stderr but accepts an optional keyword argument file to specify a different filelike object. If file is not specified, its behaviour is further tweaked with the globals X_logger or X_via_tty: if X_logger then log a warning to that logger; otherwise, if X_via_tty then open /dev/tty and write the message to it; otherwise, write the message to sys.stderr.

Function X(msg, *args, **kw)

Unconditionally write the message msg.

  • args: if not empty, format msg using %-expansion with args.
  • file: optional keyword argument specifying the output file.

If file is not None, write to it unconditionally; otherwise, if X_logger then log a warning to that logger; otherwise, if X_via_tty then open /dev/tty and write the message to it; otherwise write the message to sys.stderr.

Release files for cs.x 20180726

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.x 20180726
File Size Uploaded
cs.x-20180726.tar.gz 2.3 kB Details

Release files / cs.x-20180726.tar.gz

Download URL cs.x-20180726.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0522b26b5d68b1bc246b04555a83b10ecce2ffbbbcc37c7c95ea52d5f050fa54
BLAKE2b-256 checksum
How to use checksums
f1c234ebcb0d4cd5a48e9f54a4a1918fee070c63b6fd14bb29c8d926616556e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
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