Brief: Diff against master part 1 - add core functionalities from T78164: GSoC 2020 Info Editor Improvements (without python api for logging)
Detailed description of introduced functionalities in this patch is coming soon.
Status: works nicely
As described in D7950: Info Editor keymap and UI improvements: add active selected record and make it consistent with outliner.
Status: CLG api works ok, some changes might be a bit controversial.
- T78223: Enable/disable logger from Info Editor has been abandoned, it is too much effort (and changes) to implement
- separate log level into severity and verbosity
- add related command line arguments
- add severity verbose and debug
- add force_enable feature to CLG_LogRef for fast enabling logger
- add necessary getters and setters
- by default (explicitly) enable all loggers at level warning
- make explicit setting for always showing warning and errors
- before it was implicit in CLOG_* macros.
- CLG_type_filter_get returns filters as char but order is not preserved
Status: reports were refactored, to separate them from clog on functional level
- remove flags RPT_PRINT - this functionality overlaps with logs. Instead BKE_report reports everything it gets with logger bke.reports
- remove RPT_STORE. Once RPT_PRINT is gone explicitly setting reports for storage is the default behavior.
- add BKE_report_format with argument for specifying format (syntax highlighting)
- add feature: collect reports on startup
Info Editor changes
Status: most functionality is in place. UI review is needed. CLOG printing and syntax highlighting causes performance issues.
- use the same list for drawing and selection (SpaceInfo.last_drawn_reports/last_drawn_log_records)- for fast changing logs selecting was being offset
- separate logs and report logic to info_clog.c and info_report.c
- add autoscroll
- add log and reports filtering features
- now TextView handles multi line text and tab characters on its own
- text is encoded as TextLines borrowed from text editor so that structure is compatible with blender built in syntax highlighting
- logs conversion to string and new syntax highlighting causes performance issues. Also when list becomes too long selecting becomes slow (iterates the list).
- main text search searches only the log messages from log records
- autoscroll logic might need some tweak, currently:
- Autoscroll on: view will be shifted up when new item arrives (it will not jump to new item)
- Autoscroll off: view will always stay in the same place
- syntax colors for textview are defined implicitly
- logs would benefit from syntax highlighting but I did not manage to implement it
- report filters are implemented as bool (not enum) what leads to different selection schema (wnum: shoft +click to select multiple)
User Preferences changes
Status: exposing log and debug in preferences leads to tricky logic. I did not find a way to apply those setting on startup what leaves us with not production ready solution.
Biggest problem were:
- conflict with command line arguments
- solution was to separate saving log settings from general saving mechanism
- settings are applied quite late in code (only after reading preferences) and debug flags often trigger some special logic (like --debug-memory which must be triggered as soon as possible.
- I realized this problem quite late in GSoC and did not solve it. Proper solution would be to save these settings in separate file next to blender startup file, ask user to restart blender and read it right after reading command line arguments.
- right now my implementation of debug is the same as bpy.app.debug_*
- expose global log and deug settings via RNA system with global setters and getters
- store what command line arguments were passed in user pref runtime
- api in bpy.app.debug_* has not been removed
- if setting was overriten by command line, it is not indicated in UI
- I could not figure out how to do proper versioning and default setting. They are not done properly