How to eliminate verbose messages on the console

Hi,

I am using ‘OMERO Cli’ to import images to ‘OMERO server’.
I edited the commands and ran them on my ‘OMERO client’ PC, whose OS is UBUNTU 18.04.

The commands work well and import images to the server.
Simultaneously I receive lots of messages on the terminal. I believe that they are useful.
But sometime they are a little bit verbose.

Would you tell me how to eliminate or reduce the message?

Or is it better to write an original client code? If so, would you tell me where the sample codes are?

My commands are as follows:

project=$(omero obj -s localhost -u USER -w PASSWORD new Project name='TestProject')
dataset=$(omero obj new Dataset name='myWell')
echo $project
echo $dataset
omero import -T Dataset:name:myWell /home/omero/Data/ImportTest1/Sample_jbg/20200518/well

omero obj new ProjectDatasetLink parent=$project child=$dataset

I would appreciate it, if I could have your advice.

Thank you.

Best regards,
Hiroki Fujimoto

Fujimoto-san,

One option is to pass the --debug flag:

omero import /tmp/a.fake --debug=WARN
Using session for root@localhost:4064. Idle timeout: 10 min. Current group: system
2020-05-19 10:43:37,615 197        [      main] INFO          ome.formats.importer.ImportConfig - OMERO.blitz Version: 5.5.6
2020-05-19 10:43:37,625 207        [      main] INFO          ome.formats.importer.ImportConfig - Bioformats version: 6.3.1 revision: e355a853c5768721711cb9b29c3a27561539c4e4 date: 13 December 2019
Image:251
Other imported objects:
Fileset:251

==> Summary
1 file uploaded, 1 fileset created, 1 image imported, 0 errors in 0:00:02.719

The first two lines are printed because the log configuration has special handling for them:

$ grep ome.formats etc/logback-cli.xml
  <logger name="ome.formats" level="info"/>

You can also use the --logback flag to pass your own configuration if you would prefer:

$ omero import --help 2>&1 | grep logback
                                                [--logback LOGBACK] [-n NAME]
  --logback LOGBACK                     Path to a logback xml file.  Default: etc/logback-cli.xml

All the best,
~Josh

Dear Josh-san,

Thank you for your advice. The messages are fairly reduced.

The number of images to be imported is nearly 100 in case of a 96 well plate.
Still I see a lot of messages flowing on my console.
So I would like to write a suitable client program for my purpose, if possible.
Would you tell me where such sample codes are?

I would appreciate it, if I could have your advice.
Thank you.

Best regards,
Hiroki Fujimoto

Fujimoto-san,

We don’t currently have a sample use of the ImportLibrary, but I can point you to our three implementations:

Perhaps others in the community their own?

All the best,
~Josh

P.S. it’s also possible to make use of the same APIs from pure Python. You can see https://gitlab.com/openmicroscopy/incubator/omero-webimport/-/blob/master/omero_webimport/util/import_library.py for an example of this. The primary caveat is that you will not have access to Bio-Formats for grouping image filesets together.

Dear Josh-san,

Thank you for your advice.
I will visit the URL, study them and try.

Thank you.

Best regards,
Hiroki Fujimoto