The International Simutrans Forum

Development => Extension Requests => Topic started by: Frank on October 08, 2017, 02:20:53 PM

Title: makeobj versions info to console
Post by: Frank 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.

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


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


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
Title: Re: makeobj versions info to console
Post by: makie on October 08, 2017, 04:51:25 PM
QuoteMakeobj 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
Title: Re: makeobj versions info to console
Post by: Frank 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

./makeobj

./makeobj >info.txt

Title: Re: makeobj versions info to console
Post by: Ters 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.
Title: Re: makeobj versions info to console
Post by: Frank 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.

Quote from: Ters on October 09, 2017, 08:14:16 PM
...
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
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.
Title: Re: makeobj versions info to console
Post by: Ters 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.
Title: Re: makeobj versions info to console
Post by: makie on October 11, 2017, 05:31:06 PM
May be this helps
Quotestdout and stderr -> Datei umleiten

programm &> Datei.txt
makeobj PAK128 &> into.txt
Title: Re: makeobj versions info to console
Post by: Frank on October 11, 2017, 05:54:17 PM
i moved the copyright if out of while and compile new and works

Title: Re: makeobj versions info to console
Post by: prissi on October 17, 2017, 01:58:21 AM
Should work in r8304