Opened 6 years ago

Closed 6 years ago

#5039 closed defect (fixed)

How to supress "stdout" messages in terminal?

Reported by: ali.shirazi@… Owned by: Adrian Pop
Priority: high Milestone: 1.13.0
Component: Run-time Version: v1.13.0-dev-nightly
Keywords: Cc: Lennart Ochel

Description

Hi there,

Just wanted to ask if there is any simulation flag to turn off "stdout" messages (like the one copied below) in terminal (I am using Ubuntu 16.04 64 bit):

stdout            | info    | ... loading "weather" from "/home/...motab"
stdout            | info    | ... loading "eff1" from "/home/....motab"
stdout            | info    | ... loading "data" from "/home/.../...motab"

I know for example the "-lv=-LOG_SUCCESS" flag will turn off all the messages related to LOG_SUCCESS.

Thanks,
Ali

Change History (10)

comment:1 by ali.shirazi@…, 6 years ago

Component: *unknown*OMEdit
Owner: changed from somebody to Adeel Asghar

comment:2 by Adrian Pop, 6 years ago

These are displayed by Modelica tables.
Have a look at the code, you can disable the printout:

    parameter Boolean verboseRead=true
      "= true, if info message that file is loading is to be printed"

comment:3 by Adrian Pop, 6 years ago

I think it should be possible with: -lv=-LOG_STDOUT

comment:4 by Ali Shirazi <ali.shirazi@…>, 6 years ago

Thanks for the reply.

I did set the "verboseRead" Boolean to false, but it did not work. I also tried -lv=-LOG_STDOUT, but apparently, there is no such an option in the "lv" flag.

Any other workaround that you can think of?

Cheers,
Al

comment:5 by Adrian Pop, 6 years ago

Owner: changed from Adeel Asghar to Lennart Ochel
Status: newassigned

Hm, yes, it does seem to be always on and there is no way to change that yet:
https://github.com/OpenModelica/OMCompiler/blob/master/SimulationRuntime/c/util/omc_error.c#L88
Lennart, is it possible to add a flag to disable the LOG_INFO?

comment:6 by Adrian Pop, 6 years ago

Owner: changed from Lennart Ochel to Adrian Pop
Status: assignedaccepted

I have a fix for this, will make a PR soon.

comment:7 by Adrian Pop, 6 years ago

Cc: Lennart Ochel added
Component: OMEditRun-time
Milestone: Future1.13.0

I'm not sure if we should rename:

  • stdout to LOG_STDOUT
  • assert to LOG_ASSERT

maybe we could use -lv=-stdout and -lv=-assert
Lennart, what do you think?

It will be something like this for now:

adrpo33@ida-0030 MINGW64 /c/home/adrpo33/dev/OMTesting/
$ ./ModelicaTest.Tables.CombiTable1D.Test18.exe
LOG_STDOUT        | info    | ... loading "longLine" from "c:\home\adrpo33\dev\OpenModelica\build\lib\omlibrary\Modelica 3.2.2\Resources\Data\Tables\test.txt"
LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.

adrpo33@ida-0030 MINGW64 /c/home/adrpo33/dev/OMTesting/
$ ./ModelicaTest.Tables.CombiTable1D.Test18.exe -lv=-LOG_STDOUT
LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.

adrpo33@ida-0030 MINGW64 /c/home/adrpo33/dev/OMTesting/
$ ./ModelicaTest.Tables.CombiTable1D.Test18.exe -lv=-LOG_STDOUT,-LOG_SUCCESS

comment:9 by Adrian Pop, 6 years ago

@Ali: i guess you know that in the terminal you can redirect the stdout and stderr to a file via:

Model > log.txt 2>&1

but probably this is not something you want.

comment:10 by Adrian Pop, 6 years ago

Resolution: fixed
Status: acceptedclosed

Functionality to disable stdout and assert streams is now available via -lv=-stdout or -lv=-assert.

Note: See TracTickets for help on using tickets.