Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imcf/jython-scijava-logging
:snake::coffee::bookmark_tabs: Jython package for using SciJava's LogService for logging.
https://github.com/imcf/jython-scijava-logging
imagej2 jython jython-library logging scijava
Last synced: about 2 months ago
JSON representation
:snake::coffee::bookmark_tabs: Jython package for using SciJava's LogService for logging.
- Host: GitHub
- URL: https://github.com/imcf/jython-scijava-logging
- Owner: imcf
- License: gpl-3.0
- Created: 2018-10-23T21:58:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-21T14:25:54.000Z (10 months ago)
- Last Synced: 2024-03-26T21:50:22.657Z (9 months ago)
- Topics: imagej2, jython, jython-library, logging, scijava
- Language: Python
- Size: 36.1 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SciJava log handler for Python 🐍☕📑
[![DOI](https://zenodo.org/badge/154402009.svg)][doi]
A very thin Python package (mavenized for [ImageJ2][imagej]) to use the
[SciJava][gh_scijava] [LogService][gh_sj_logservice] as a handler for
[Python's logging facility][py_logging]. See the wiki page about
[Logging][ij_logging] for more details about ImageJ's logging framework.Developed and provided by the [Imaging Core Facility (IMCF)][imcf] of the
Biozentrum, University of Basel, Switzerland.## Example usage
The code in [extra/scripts/example.py](extra/scripts/example.py) demonstrates
how to use the handler in an ImageJ2 Python script utilizing the fabulous
[Script Parameters][ij_script_params] for retrieving the LogService instance.Running this code from ImageJ will result in the following messages being
printed to the console or the *Log* window, depending on how you launch ImageJ:```log
[Fri Jan 5 12:25:15 CET 2018] [ERROR] +++ new round of messages (level WARNING) +++
[Fri Jan 5 12:25:15 CET 2018] [WARNING] warn log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] error log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] critical log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] --- finished round of messages (level WARNING) ---
[Fri Jan 5 12:25:15 CET 2018] [ERROR] +++ new round of messages (level INFO) +++
[Fri Jan 5 12:25:15 CET 2018] [INFO] info log message
[Fri Jan 5 12:25:15 CET 2018] [WARNING] warn log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] error log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] critical log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] --- finished round of messages (level INFO) ---
[Fri Jan 5 12:25:15 CET 2018] [ERROR] +++ new round of messages (level DEBUG) +++
[Fri Jan 5 12:25:15 CET 2018] [DEBUG] debug log message
[Fri Jan 5 12:25:15 CET 2018] [INFO] info log message
[Fri Jan 5 12:25:15 CET 2018] [WARNING] warn log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] error log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] critical log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] --- finished round of messages (level DEBUG) ---
[Fri Jan 5 12:25:15 CET 2018] [ERROR] +++ new round of messages (level WARNING) +++
[Fri Jan 5 12:25:15 CET 2018] [WARNING] warn log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] error log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] critical log message
[Fri Jan 5 12:25:15 CET 2018] [ERROR] --- finished round of messages (level WARNING) ---
```[imcf]: https://www.biozentrum.unibas.ch/imcf
[imagej]: https://imagej.net
[ij_logging]: https://imagej.net/Logging
[ij_script_params]: http://imagej.net/Script_Parameters
[py_logging]: https://docs.python.org/2/library/logging.html
[gh_scijava]: https://github.com/scijava
[gh_sj_logservice]: https://github.com/scijava/scijava-common/tree/master/src/main/java/org/scijava/log
[doi]: https://zenodo.org/badge/latestdoi/154402009