Difference between revisions of "2014 Winter Project Week:Logging"

From NAMIC Wiki
Jump to: navigation, search
m
Line 32: Line 32:
 
*
 
*
 
</div>
 
</div>
 +
 +
==Discussion==
 +
* Logging macros:
 +
** Levels: error, warning, debug
 +
** Collect at each line: message + get the filename and line number automatically
 +
** Log to file: timestamp, level, file, line number, message
 +
** Macro names:
 +
*** QT: use standard qDebug, qWarning, etc. macros - in QT5 they will provide everything that we need => '''Jc''' will check if these QT features can be backported
 +
*** VTK: use standard vtkDebugMacro, vtkWarningMacro, etc. in VTK classes; outside VTK classes use generic VTK logging macros. Not all required macros exist => '''Nicole''' will check how they could be added
 +
* Logging to file: => '''Andras'''
 +
** All errors end up at CTK error model, so logging to file should be added there
 +
** Log rotation is needed (keep last N log files)
 +
** Write to file after each logged message
 +
** Make logging level configurable (by default error&warning only)
  
 
== Reference ==
 
== Reference ==
 
* [http://slicer-devel.65872.n3.nabble.com/Use-proper-null-pointer-checking-instead-of-assert-tp4030168p4030569.html Slicer developers mailings list correspondence]
 
* [http://slicer-devel.65872.n3.nabble.com/Use-proper-null-pointer-checking-instead-of-assert-tp4030168p4030569.html Slicer developers mailings list correspondence]
 
*[https://github.com/naucoin/Slicer/compare/3526-use-checking-instead-of-assert Github topic branch removing asserts and using qCritical and vtkErrorMacros]
 
*[https://github.com/naucoin/Slicer/compare/3526-use-checking-instead-of-assert Github topic branch removing asserts and using qCritical and vtkErrorMacros]

Revision as of 16:09, 7 January 2014

Home < 2014 Winter Project Week:Logging

Key Investigators

  • BWH: Nicole Aucoin
  • Isomics: Steve Pieper
  • Kitware: Jean-Cristophe Fillion-Robin
  • Queen's: Csaba Pinter, Andras Lasso

Project Description

Objective

  • Standardize logging in Slicer (correspondence)
  • Explore logging to file


Approach, Plan

  • Discuss unifying debug, warning and error logging over Qt and VTK based files
  • Discuss back porting the message logger class to CTK
  • Discuss UI features from a developer and user point of view
  • Implement agreed upon changes

Progress

Discussion

  • Logging macros:
    • Levels: error, warning, debug
    • Collect at each line: message + get the filename and line number automatically
    • Log to file: timestamp, level, file, line number, message
    • Macro names:
      • QT: use standard qDebug, qWarning, etc. macros - in QT5 they will provide everything that we need => Jc will check if these QT features can be backported
      • VTK: use standard vtkDebugMacro, vtkWarningMacro, etc. in VTK classes; outside VTK classes use generic VTK logging macros. Not all required macros exist => Nicole will check how they could be added
  • Logging to file: => Andras
    • All errors end up at CTK error model, so logging to file should be added there
    • Log rotation is needed (keep last N log files)
    • Write to file after each logged message
    • Make logging level configurable (by default error&warning only)

Reference