Author Topic: makeobj versions info to console  (Read 321 times)

0 Members and 1 Guest are viewing this topic.

Offline Frank

makeobj versions info to console
« on: October 08, 2017, 02:20:53 PM »
Since version 120 ( makeobj 55.4 ), no version information is output at Makeobj.

This is less good, because you can no longer understand with which version a pak file was created.

With the online data, the console output is packed into the zip file.

Code: [Select]
Makeobj version 49 for simutrans 101.1 Nightly and higher
(c) 2002-2006 V. Meyer , Hj. Malthaner, M. Pristovsek ...
...

Code: [Select]
Makeobj version 50 for simutrans 102.2.1 Release candidate and higher
(c) 2002-2006 V. Meyer , Hj. Malthaner, M. Pristovsek ...
...

Code: [Select]
Makeobj version 55.1 for Simutrans 112.1 and higher

(c) 2002-2012 V. Meyer, Hj. Malthaner, M. Pristovsek & Simutrans development team
...

55.4 and 60 not this output

Offline makie

Re: makeobj versions info to console
« Reply #1 on: October 08, 2017, 04:51:25 PM »
Quote
Makeobj version 60.0 for Simutrans 120.2.2 and higher
writing file flos.pak
   reading file ./flos.dat
      packing vehicle.Flos
      packing vehicle.Flos_Anhaenger
makeobj from OpenSUSE Game Repo

Offline Frank

Re: makeobj versions info to console
« Reply #2 on: October 09, 2017, 05:37:50 PM »
The version info is output on the console. However, it is no longer redirected to the file with.

Compare the following views

Code: [Select]
./makeobj
Code: [Select]
./makeobj >info.txt
« Last Edit: October 09, 2017, 05:55:25 PM by Frank »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4806
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: makeobj versions info to console
« Reply #3 on: October 09, 2017, 08:14:16 PM »
This changed way back in 2013, r6888. When run without arguments, version information is only written to stderr. You only redirected stdout in your examples above. If run with "verbose" or "debug", it also prints version information to stdout.

There is however an oddity in the code. Printing version information to stdout happens if log level is 2 or higher. 2 is the default, "quiet" sets it to 1, "verbose" to 2 and "debug" to 3. However, the logging happens inside the loops looking for "debug", "verbose" and "quiet", so it is never done on default log level after all.

Offline Frank

Re: makeobj versions info to console
« Reply #4 on: October 10, 2017, 12:58:31 PM »
The additional outputs of debug and verbose appear again only on the console and not in the redirected file.

Therefore, they are useless if, as with the online-dat, the console is not visible.

...
There is however an oddity in the code. Printing version information to stdout happens if log level is 2 or higher. 2 is the default, "quiet" sets it to 1, "verbose" to 2 and "debug" to 3. ...

This is not quite true.

debuglevel=1 - quiet
debuglevel=2 - default
debuglevel=3 - verbose
debuglevel=4 - debug

So the default=2 should output the version info since after this code.
makeobj.cc line 45-48
Code: [Select]
if(  debuglevel>1  ) {
puts( "\nMakeobj version " MAKEOBJ_VERSION " for Simutrans " VERSION_NUMBER " and higher\n" );
puts( "(c) 2002-2012 V. Meyer, Hj. Malthaner, M. Pristovsek & Simutrans development team\n" );
}

Only this code is within the evaluation for the parameters that are not executed if none of these 3 parameters are specified.

Therefore, quiet is superfluous because the default causes the same.
« Last Edit: October 17, 2017, 09:02:51 AM by Frank »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4806
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: makeobj versions info to console
« Reply #5 on: October 10, 2017, 03:11:09 PM »
You cut my quote too short. I went on to state the same things you did. Default and quiet does not log version to stdout, although the former probably was intended. Debug and verbose does log to stdout. It is always logged to stderr.

Offline makie

Re: makeobj versions info to console
« Reply #6 on: October 11, 2017, 05:31:06 PM »
May be this helps
Quote
stdout and stderr -> Datei umleiten

programm &> Datei.txt
makeobj PAK128 &> into.txt

Offline Frank

Re: makeobj versions info to console
« Reply #7 on: October 11, 2017, 05:54:17 PM »
i moved the copyright if out of while and compile new and works


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8795
  • Total likes: 319
  • Helpful: 229
  • Languages: De,EN,JP
Re: makeobj versions info to console
« Reply #8 on: October 17, 2017, 01:58:21 AM »
Should work in r8304