Skip to content

Add full example for scijava_logger #38

Description

@ehrenfeu

Expand the docstring with a complete example of how this is supposed to be used from within an ImageJ2 script, i.e.

  • Header with #@ script parameter.
  • Logging initialization (i.e. calling this function).
  • Logging usage.

def scijava_logger(log_service):
"""Prepare logger and set the level according to stored ImageJ preferences.
Parameters
----------
log_service : org.scijava.log.LogService
The LogService instance, usually retrieved in a SciJava script by using
the script parameters annotation `#@ LogService logs` or equivalent.
Returns
-------
logger : logging.Logger
The Python logger object connected to SciJava's LogService.
"""

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationMissing documentation, docstring conventions, ...next-releaseIssues blocking the next release

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions