Skip to main content

Shared logging facade for the scistack framework (dual-sink console/file logging with layer tags)

Project description

scistacklog

The shared logging facade for every scistack layer. This is the lowest-level package in the stack — it has no dependencies, and every other layer (scifor, scidb, sciduckdb, …) emits through it or through a plain logging.getLogger("<layer>") child logger that it covers.

Design

One Log call, two destinations with independent levels:

  • console (stderr) — a concise pipeline narrative for the person running the pipeline. Time-only timestamps; level prefix only at WARN and above.

    14:32:06 [scifor] for_each(compute_psd) — 120 iterations: subject=12 values [s01,…,s12]
    14:33:15 [scifor] WARN: iteration failed: subject=s03, session=2 — ValueError: bad channel count
    
  • file (scidb.log next to the database, pointed via Log.set_path, done automatically by scidb.configure_database()) — the run document. One record per line: date + millisecond timestamp, level, originating layer.

    2026-07-07 14:32:06.001 INFO  [scifor] for_each(compute_psd) — 120 iterations: subject=12 values [s01,…,s12]
    2026-07-07 14:33:20.100 INFO  [scidb] [timing] save_batch(PSD): 114 items, 12 schemas, 0.412s
    

Both sinks default to INFO. DEBUG detail (per-iteration lines, timing phase tables, framework internals) is opt-in:

from scistacklog import Log

Log.set_level("DEBUG", sink="file")   # full detail in the file only
Log.set_level("DEBUG")                # both sinks

or set the SCIDB_LOG_LEVEL environment variable (applies to both sinks), or pass -v to the scidb CLI.

Usage

from scistacklog import Log

Log.info("for_each(compute_psd) — 120 iterations", layer="scifor")
Log.debug("combo detail: %s", combo, layer="scifor")
Log.error("save failed", layer="scidb", exc_info=True)

layer must be one of scistacklog.LAYERS (scidb, scifor, sciduck, scihist, scilineage, scistack, scistack_gui, matlab).

Contracts

  • caplog: level filtering happens on the two handlers, never on the loggers — every record propagates to the root logger, so pytest's caplog captures everything regardless of sink levels. Log.*(...) with the default layer emits on logger "scidb", unchanged from the historical implementation.
  • MATLAB: scimatlab's +scidb/Log.m delegates to this class via py.scidb.log.Log.* (a re-export shim in scidb). The numeric level scale (DEBUG=0 … ERROR=3) and positional call shapes are frozen for that bridge.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scistacklog-0.1.10.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scistacklog-0.1.10-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file scistacklog-0.1.10.tar.gz.

File metadata

  • Download URL: scistacklog-0.1.10.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for scistacklog-0.1.10.tar.gz
Algorithm Hash digest
SHA256 dcaf770d037b6de75aa51e3add24428b963500cbd154780268a31d2a2b7200bd
MD5 4d09bf5c235d8a9b3c7c1c00b7bcc9be
BLAKE2b-256 c76cc0aa0f176e8096135f94cd5d924f46bfb64ae7897d70215777ce75fd6a97

See more details on using hashes here.

Provenance

The following attestation bundles were made for scistacklog-0.1.10.tar.gz:

Publisher: publish.yml on mtillman14/scistack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scistacklog-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: scistacklog-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for scistacklog-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 4c433eefb73007853c925e211a5a9f4193780e175100dc05943f274bc64d0205
MD5 867c0203a5e1751ad95120fbf8dca94a
BLAKE2b-256 7da8faff7e461d4b074a581977f59d3e3da3a25e7c26c9848b5e7bcbc1f2a4a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scistacklog-0.1.10-py3-none-any.whl:

Publisher: publish.yml on mtillman14/scistack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page