Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Feature Request Better error-logging for baker problem

Discussion in 'Entity Component System' started by StefanWo, Dec 12, 2022.

  1. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    Hi, i had troubles to find the right class, due to its just logging the name, not the fullname.
    I just add a public Baker:Baker<AuthoringType>{} to my Authoring classes, so i just see "Baker Baker" in the following log.
    Code (CSharp):
    1. [Worker17] InvalidOperationException: Baking error: Attempt to add duplicate component GridRotation for Baker Baker with authoring component GridRotationAuthoring.  Previous component added by Baker Baker
    2. Unity.Entities.IBaker.AddDebugTrackingForComponent (Unity.Entities.Entity entity, Unity.Entities.TypeIndex typeIndex) (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities.Hybrid/Baking/Baker.cs:1282)
    3.  
    Due to its running in a worker, i can't debug into it, so its pretty hard to figure out whats the other baker.

    So requested Change: Replace 3x .Name with .FullName in IBaker.AddDebugTrackingForComponent
     
    Occuros likes this.
  2. Blargenflargle

    Blargenflargle

    Joined:
    Feb 24, 2019
    Posts:
    92
    I'm facing the same problem and I second this.
     
  3. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    117
    Lets hope some developer see it and do this small change ;)
     
  4. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    262
    I am still very new to ECS1.0 and the bakers, but i think the baker code can be triggered in debug mode by clicking 'reimport' 'open' button on the subscene while having Visual Studio attached to Unity editor in Debug mode.

    In general I find that the most debug info comes when
    - disable burst compile
    - have subscene 'open'
    - have unity editor in debug mode
    Then when an error is hit (even without Visual studio attached) the line number of the non-generated code is given in the console error.
     
    Last edited: Jan 4, 2023
    Jpritch71 likes this.
  5. topher_r

    topher_r

    Unity Technologies

    Joined:
    Jun 14, 2019
    Posts:
    36
    Great suggestion, obvious oversight from our side :)

    We will make this change
     
    StefanWo likes this.