PedestrianDynamics / jupedsim

JuPedSim is an open source pedestrian dynamics simulator
http://jupedsim.org
Other
41 stars 28 forks source link

Setting a log file location removes errors from output to stdout #459

Closed Ozaq closed 4 years ago

Ozaq commented 5 years ago

JuPedSim - JPScore

Describe the bug Setting a logfile path in the header section of a ini file will remove error output from stdout.

STDOUT:

./bin/jpscore /mnt/fast/projects/jpscore/demos/scenario_2_bottleneck/bottleneck_ini.xml

INFO:   Loading and parsing the project file </mnt/fast/projects/jpscore/demos/scenario_2_bottleneck/bottleneck_ini.xml>
INFO:   logfile </mnt/fast/projects/jpscore/demos/scenario_2_bottleneck/log.txt>
----
JuPedSim - JPScore

Current date   : Aug  8 2019 09:50:09
Version        : 0.8.4
Compiler       : g++ (9.1.0)
Commit hash    : v0.8.4-159-gbbe10374
Commit date    : Wed Aug 7 16:16:48 2019
Branch         : develop
----

INFO:   random seed <12542>
INFO:   Maximal simulation time <100.00> seconds
INFO:   geometry <bottleneck_geo.xml>
INFO:   Using num_threads <8> threads (8 available)
INFO:   output file  </mnt/fast/projects/jpscore/demos/scenario_2_bottleneck/bottleneck_traj.xml>
INFO:   in format <xml-plain> at <8> frames per seconds
INFO:   could not find any JPSfire information
INFO:   could not find any JPSfire information

INFO:   Using Tordeux2015 model
INFO:   Parsing the model parameters
INFO:   pSolver <1>
WARNING:    Decreased stepsize from <0.010000> to <0.009615> to match fps
INFO:   stepsize <0.009615>
INFO:   exit_crossing_strategy < 3 >
INFO:   linked cells enabled with size  <2.20>
INFO:   frep_ped a=8.00, D=0.10
INFO:   frep_wall a=5.00, D=0.02

INFO:   Parsing agents  parameters
INFO:   Parsing the group parameter id [1]
INFO:   desired speed mu=1.000000 , sigma=0.001000
INFO:   Bmax mu=0.150000 , sigma=0.000000
INFO:   Bmin mu=0.150000 , sigma=0.000000
INFO:   Amin mu=0.150000 , sigma=0.000000
INFO:   Tau mu=0.500000 , sigma=0.001000
INFO:   Atau mu=0.000000 , sigma=0.000000
INFO:   T mu=1.000000 , sigma=0.001000
INFO:   Parsing the project file completed
LoadGeometry: file: /mnt/fast/projects/jpscore/demos/scenario_2_bottleneck/bottleneck_geo.xml

Got 0 sources
Building has 30 peds

time:   0.09 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   0.18 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   0.28 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   0.38 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   0.47 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   0.57 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   0.66 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   0.76 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   0.86 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   1.91 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   2.88 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   3.84 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   4.80 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   5.76 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   6.72 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   7.68 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   8.64 ( 100)  | Agents:     30 / 30 [ 0.0%]
time:   9.61 ( 100)  | Agents:     28 / 30 [ 6.7%]
time:  10.57 ( 100)  | Agents:     28 / 30 [ 6.7%]
time:  11.53 ( 100)  | Agents:     26 / 30 [13.3%]
time:  12.49 ( 100)  | Agents:     24 / 30 [20.0%]
time:  13.45 ( 100)  | Agents:     22 / 30 [26.7%]
time:  14.41 ( 100)  | Agents:     21 / 30 [30.0%]
time:  15.38 ( 100)  | Agents:     19 / 30 [36.7%]
time:  16.34 ( 100)  | Agents:     19 / 30 [36.7%]
time:  17.30 ( 100)  | Agents:     17 / 30 [43.3%]
time:  18.26 ( 100)  | Agents:     14 / 30 [53.3%]
time:  19.22 ( 100)  | Agents:     12 / 30 [60.0%]
time:  20.18 ( 100)  | Agents:     11 / 30 [63.3%]
time:  21.14 ( 100)  | Agents:     10 / 30 [66.7%]
time:  22.11 ( 100)  | Agents:      8 / 30 [73.3%]
time:  23.07 ( 100)  | Agents:      6 / 30 [80.0%]
time:  24.03 ( 100)  | Agents:      5 / 30 [83.3%]
time:  24.99 ( 100)  | Agents:      3 / 30 [90.0%]
time:  25.95 ( 100)  | Agents:      1 / 30 [96.7%]

Exec Time [s]     : 0.00
Evac Time [s]     : 26.64
Realtime Factor   : inf X 
Number of Threads : 8
Warnings          : 2
Errors            : 3
Deleted Agents    : 0

Contents of log.txt:

INFO:   Loading and parsing the persons attributes
INFO:   risk tolerance mu = 0.000000, risk tolerance sigma = 1.000000

INFO:   ...Done
INFO:   Not parsing transition from file
INFO:   Got 2 transitions
INFO:   Loading building file successful!!!

INFO:   Loading goal
INFO:     Goal id: 0
INFO:     Goal caption: goal 1
INFO:     Goal room_id: -1
INFO:     Goal subroom_id: -1
INFO:     finished parsing goal 0
INFO:   Goal file not parsed
INFO:   done with loading extra routing information
INFO:   Loading the traffic info
Info:     no room info found in inifile
INFO:   Parsed Door: 
    >> ID: 2
    >> state: open

Info:     no traffic file found.
INFO:   Done with loading traffic info file
--------
INFO:   Loading the train info
WARNING:    No train constraints were found. Continue.
INFO:   Init Geometry
INFO:   enter correct ...
INFO:   Leave geometry correct with success (0.019 s)
INFO:   InitInsideGoals successful!!!

INFO:   Init Geometry successful!!!

INFO:   Init Distribute
INFO:   Distributing 30 Agents in Room/Subrom [1/0]! Maximum allowed: 228
    ...Done
INFO:   Initializing the grid with cell size: 2.200000 
INFO:   Done with Initializing the grid 
INFO:   Init the Global Router Engine
INFO:   Exit to outside found: 15 [trans_2_room_0_subroom_0]
INFO:   Done with the Global Router Engine!
INFO:   Checking the geometry for artifacts: (Ignore Warnings, if ff_[...] router is used!)
INFO:   ...Done!!!

INFO:    Init Operational Model starting ...
INFO:    Init Operational Model done
Got 0 Train Types
WARNING:    Got 0 Train Time Tables
INFO:    nPeds 30 received
INFO:   Adding a new routing Engine with the key: 2:3

INFO:   Looking for pre-defined events in other files
INFO:   No realtime events found
INFO:   Parsing the event file
ERROR:  Failed to open file
ERROR:   could not parse the event file.
ERROR:  Could not initialize events handling
INFO:   Reading schedule
INFO:   No events found
INFO:   Start runSimulation() with 30 pedestrians

INFO:   End runSimulation()

Exec Time [s]     : 0.00
Evac Time [s]     : 26.64
Realtime Factor   : inf X 
Number of Threads : 8
Warnings          : 2
Errors            : 3
Deleted Agents    : 0

Expected behavior Contents of logfile and std out are identical.

Additional context I think the option should be dropped from the headers section and the full output should always been written to a file of the pattern jpscore-<date>.log and written to stdout.

chraibi commented 5 years ago

I agree with this suggestion:

is someone working on this already?

Ozaq commented 5 years ago

is someone working on this already?

I think I can create a PR on the weekend unless someone else want to have a shot.

chraibi commented 4 years ago

do we still have this option?

Ozaq commented 4 years ago

@chraibi & @chraibi closed because with the logging rework no log file can be set anymore