TMPE icon indicating copy to clipboard operation
TMPE copied to clipboard

settings for verbose log

Open kianzarrin opened this issue 2 years ago • 4 comments

  <Debug>
    <Switches>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
      <boolean>false</boolean>
    </Switches>
    <ExtVehicleType>None</ExtVehicleType>
    <ExtPathMode>None</ExtPathMode>
  </Debug>

Its hard to set the specific debug switch. I have to read the code and then count the lines to turn on the switch. it would be nice to be able to set these in the maintenance tab. that way I don't have to reload config all the time either :)

    public class DebugSettings {
        private int nodeId_ = 0;
        public static int NodeId => GlobalConfig.Instance.Debug.nodeId_;
        private int segmentId_ = 0;
        public static int SegmentId => GlobalConfig.Instance.Debug.segmentId_;
        private int startSegmentId_ = 0;
        ...

Also I have no way of setting debug log for specific segment/node/... even from the global config file. so we need these options too

kianzarrin avatar Apr 16 '22 07:04 kianzarrin

@aubergine10 @krzychu124 is there anyway of setting the segmentId_ for verbose logs that I am not aware of?

kianzarrin avatar Apr 16 '22 07:04 kianzarrin

afaik it was used only for specific testing, like you have got a problematic savegame, know the segment or node and want to log only data related to that segment or node (so you are compiling the mod with hardcoded values). If you could expose instance somewhere (Lifecycle object via property then you could use mod tools to set it). Anyways I see much better way, just require a basic tool to read id of entity(segment/node) you clicked

krzychu124 avatar Apr 17 '22 16:04 krzychu124

it can help a lot with routings and path finding.

kianzarrin avatar Apr 17 '22 19:04 kianzarrin

I'll try to refactor my experiment from my other mod and include it into TM:PE as a debug tool

krzychu124 avatar Apr 17 '22 19:04 krzychu124