What are debugging best practices for blueprints?
For example, here are some questions:
- What is the best way to display logging/debug information in such a way that it is easy to turn on and off? Right now I have just been using “Print String” in my blueprints. That works but pretty soon it becomes a real mess. Ideally I would like some kind of debug/logging function where I can configure what messages are printed by what classes or by level of message or something. Does such a thing exist? If not, how should one display logging/debug messages?
- How should one do something like an assert statement? For example, it seems like I sometimes need to do a lot of casting. Since I’m not yet an expert on this my casts sometimes fail. Currently I use Print String to notify myself when that happens but it is clunky. Ideally, it would be nice to have a blueprint node called something like assert which takes in an exec line, a boolean (defaulting to false), and an optional string. When the condition is false, something should get displayed or logged saying exactly which blueprint the assert failed in. That way I wouldn’t have to constantly type the names of which blueprint the cast is failing when I use my “Print String” hack. Maybe I could write a blueprint macro to do this but I would need to know how to get the name of the blueprint the macro is running in dynamically.
- Sometimes I want to draw debug information (e.g., Draw Debug Arrow). Is there a convenient way to turn such things on and off as asked in 1?
- More generally is there a tutorial or wiki somewhere describing best practices for debugging/logging or libraries one can use for such things?