Proposals:Logging: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
m (Reverted edits by OekRts (Talk); changed back to last version by Andy)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div style="overflow:auto; height: 1px;">
= Requirements =


[http://southwestairlinesfares.enic.nl/ southwest airlines fares]
== Current Status ==
[http://continentalairlinesreservation.enic.nl/ continental airlines reservation]
[http://deltaairlinesschedules.enic.nl/ delta airlines schedules]
[http://norwegiancruiselines.enic.nl/ norwegian cruise lines]
[http://alohaairlines.enic.nl/ aloha airlines]
[http://dirtcheapairlinetickets.enic.nl/ dirt cheap airline tickets]
[http://hawaiianairlines.enic.nl/ hawaiian airlines]
[http://celinediontickets.enic.nl/ celine dion tickets]
[http://airlineticketforunder100.enic.nl/ airline ticket for under 100]
[http://airlineflighttracking.enic.nl/ airline flight tracking]
[http://philadelphiaeaglestickets.enic.nl/ philadelphia eagles tickets]
[http://carribeancruises.enic.nl/ carribean cruises]
[http://alaskaairlinesreservations.enic.nl/ alaska airlines reservations]
[http://spiritairline.enic.nl/ spirit airline]
[http://royalcarribeancruises.enic.nl/ royal carribean cruises]
[http://waltdisneyworldtickets.enic.nl/ walt disney world tickets]
[http://honeymooncruises.enic.nl/ honeymoon cruises]
[http://trackanairlineflightinprogress.enic.nl/ track an airline flight in progress]
[http://cheapnbatickets.enic.nl/ cheap nba tickets]
[http://supercheapairplanetickets.enic.nl/ super cheap airplane tickets]
[http://greenbaypackerstickets.enic.nl/ green bay packers tickets]
[http://alaskacruisetour.enic.nl/ alaska cruise tour]
[http://discountedbroadwaytickets.enic.nl/ discounted broadway tickets]
[http://americaneagleairlines.enic.nl/ american eagle airlines]
[http://southwestairlinesreservations.enic.nl/ southwest airlines reservations]
[http://broadwayticketbroker.enic.nl/ broadway ticket broker]
[http://alaskaairlinescoupons.enic.nl/ alaska airlines coupons]
[http://cheepairlinetickets.enic.nl/ cheep airline tickets]
[http://continentalairlineschedules.enic.nl/ continental airline schedules]
[http://lionkingbroadwaytickets.enic.nl/ lion king broadway tickets]
[http://deltasongairlines.enic.nl/ delta song airlines]
[http://cheapairfaresairlineconsolidators.enic.nl/ cheap airfares airline consolidators]
[http://discountbroadwayshowtickets.enic.nl/ discount broadway show tickets]
[http://hollandamericaalaskacruises.enic.nl/ holland america alaska cruises]
[http://ryaninternationalairlines.enic.nl/ ryan international airlines]
[http://spiritairlinereservations.enic.nl/ spirit airline reservations]
[http://deltaairlinesreservations.enic.nl/ delta airlines reservations]
[http://deltaairlinesflightschedule.enic.nl/ delta airlines flight schedule]
[http://celebrityalaskacruises.enic.nl/ celebrity alaska cruises]
[http://americanairlinesarena.enic.nl/ american airlines arena]
[http://hollandamericaalaskacruise.enic.nl/ holland america alaska cruise]
[http://southwestairlinesinternetspecials.enic.nl/ southwest airlines internet specials]
[http://cheapchicagocubstickets.enic.nl/ cheap chicago cubs tickets]
[http://cheapdisneylandtickets.enic.nl/ cheap disneyland tickets]
[http://honeymooncruisediscounts.enic.nl/ honeymoon cruise discounts]
[http://trackanairlineflight.enic.nl/ track an airline flight]
[http://airlinetravelforpets.enic.nl/ airline travel for pets]
[http://discountedalaskacruises.enic.nl/ discounted alaska cruises]
[http://unitedairlineshomepage.enic.nl/ united airlines homepage]
[http://tahiticruises.enic.nl/ tahiti cruises]
[http://southwestairlineshomepage.enic.nl/ southwest airlines homepage]
[http://cubsticketsonline.enic.nl/ cubs tickets online]
[http://chicagocubsticketbroker.enic.nl/ chicago cubs ticket broker]
[http://spiritairlinesschedule.enic.nl/ spirit airlines schedule]
[http://AliciaSilverstonenude.enic.nl/ Alicia Silverstone nude]
[http://AliciaWittnude.enic.nl/ Alicia Witt nude]
[http://AmandaPeetnude.enic.nl/ Amanda Peet nude]
[http://AshleyScottnude.enic.nl/ Ashley Scott nude]
[http://ChristinaRiccinude.enic.nl/ Christina Ricci nude]
[http://ErikaChristensennude.enic.nl/ Erika Christensen nude]
[http://JenniferConnellynude.enic.nl/ Jennifer Connelly nude]
[http://JenniferEspositonude.enic.nl/ Jennifer Esposito nude]
[http://JenniferJasonLeighnude.enic.nl/ Jennifer Jason Leigh nude]
[http://JillRitchienude.enic.nl/ Jill Ritchie nude]
[http://JordanBrewsternude.enic.nl/ Jordan Brewster nude]
[http://KelliGarnernude.enic.nl/ Kelli Garner nude]
[http://KellyLynchnude.enic.nl/ Kelly Lynch nude]
[http://LaurenGrahamnude.enic.nl/ Lauren Graham nude]
[http://LeilaArcierinude.enic.nl/ Leila Arcieri nude]
[http://MelissaGeorgenude.enic.nl/ Melissa George nude]
[http://MichelleTrachtenbergnude.enic.nl/ Michelle Trachtenberg nude]
[http://MirandaOttonude.enic.nl/ Miranda Otto nude]
[http://NaomiWattsnude.enic.nl/ Naomi Watts nude]
[http://PenelopeCruznude.enic.nl/ Penelope Cruz nude]
[http://PiperPerabonude.enic.nl/ Piper Perabo nude]
[http://PortiaDeRossinude.enic.nl/ Portia De Rossi nude]
[http://RachelNicholsnude.enic.nl/ Rachel Nichols nude]
[http://RachelWeisznude.enic.nl/ Rachel Weisz nude]
[http://SandraBullocknude.enic.nl/ Sandra Bullock nude]
[http://SunnyMabreynude.enic.nl/ Sunny Mabrey nude]
[http://TeaLeoninude.enic.nl/ Tea Leoni nude]
[http://AmySmartnude.enic.nl/ Amy Smart nude]
[http://AnnaKournikovanude.enic.nl/ Anna Kournikova nude]
[http://BrookeBurkenude.enic.nl/ Brooke Burke nude]
[http://ElishaCuthbertnude.enic.nl/ Elisha Cuthbert nude]
[http://ElizaDushkunude.enic.nl/ Eliza Dushku nude]
[http://EstellaWarrennude.enic.nl/ Estella Warren nude]
[http://EvaLongorianude.enic.nl/ Eva Longoria nude]
[http://EvaMendesnude.enic.nl/ Eva Mendes nude]
[http://HeatherLocklearnude.enic.nl/ Heather Locklear nude]
[http://HilarySwanknude.enic.nl/ Hilary Swank nude]
[http://JaimePresslynude.enic.nl/ Jaime Pressly nude]
[http://JanetJacksonnude.enic.nl/ Janet Jackson nude]
[http://JenniferConnellynude.enic.nl/ Jennifer Connelly nude]
[http://JenniferGarnernude.enic.nl/ Jennifer Garner nude]
[http://JenniferLothropnude.enic.nl/ Jennifer Lothrop nude]
[http://JessicaBielnude.enic.nl/ Jessica Biel nude]
[http://KatiePricenude.enic.nl/ Katie Price nude]
[http://KristinDavisnude.enic.nl/ Kristin Davis nude]
[http://MischaBartonnude.enic.nl/ Mischa Barton nude]
[http://MollySimsnude.enic.nl/ Molly Sims nude]
[http://NatashaHenstridgenude.enic.nl/ Natasha Henstridge nude]
[http://NicoletteSheridannude.enic.nl/ Nicolette Sheridan nude]
[http://NikkiCoxnude.enic.nl/ Nikki Cox nude]
[http://RachelNicholsnude.enic.nl/ Rachel Nichols nude]
[http://RhonaMitranude.enic.nl/ Rhona Mitra nude]
[http://RoseMcGowannude.enic.nl/ Rose McGowan nude]
[http://SandraBullocknude.enic.nl/ Sandra Bullock nude]
[http://SarahJessicaParkernude.enic.nl/ Sarah Jessica Parker nude]
[http://TeriHatchernude.enic.nl/ Teri Hatcher nude]
[http://VanessaMarcilnude.enic.nl/ Vanessa Marcil nude]
[http://MandyMoorenude.enic.nl/ Mandy Moore nude]
[http://MelissaJoanHartnude.enic.nl/ Melissa Joan Hart nude]
[http://NeveCampbellnude.enic.nl/ Neve Campbell nude]
[http://MonicaBelluccinude.enic.nl/ Monica Bellucci nude]
[http://NataliePortmannude.enic.nl/ Natalie Portman nude]
[http://NicoleKidmannude.enic.nl/ Nicole Kidman nude]
[http://PamelaAndersonnude.enic.nl/ Pamela Anderson nude]
[http://ParisHiltonnude.enic.nl/ Paris Hilton nude]
[http://PenelopeCruznude.enic.nl/ Penelope Cruz nude]
[http://ReeseWitherspoonnude.enic.nl/ Reese Witherspoon nude]
[http://SalmaHayeknude.enic.nl/ Salma Hayek nude]
[http://SarahMichelleGellarnude.enic.nl/ Sarah Michelle Gellar nude]
[http://ShannonElizabethnude.enic.nl/ Shannon Elizabeth nude]
[http://SharonStonenude.enic.nl/ Sharon Stone nude]
[http://TaraReidnude.enic.nl/ Tara Reid nude]
[http://UmaThurmannude.enic.nl/ Uma Thurman nude]
[http://angelina-jolie-nude.enic.nl/ Angelina Jolie nude]
[http://jessica-alba-nude.enic.nl/ Jessica Alba nude]
[http://alyssamilano.enic.nl/ Alyssa Milano nude]
[http://annanicolesmith.enic.nl/ Anna Nicole Smith nude]
[http://britneyspears.enic.nl/ Britney Spears nude]
[http://camerondiaznude.enic.nl/ Cameron Diaz nude]
[http://carmenelectra.enic.nl/ Carmen Electra nude]
[http://charlizetheron.enic.nl/ Charlize Theron nude]
[http://aguileranude.enic.nl/ Christina Aguilera nude]
[http://demimoorenude.enic.nl/ Demi Moore nude]
[http://deniserichards.enic.nl/ Denise Richards nude]
[http://drewbarrymore.enic.nl/ Drew Barrymore nude]
[http://berkleynude.enic.nl/ Elizabeth Berkley nude]
[http://gwynethpaltrow.enic.nl/ Gwyneth Paltrow nude]
[http://halleberrynude.coms.nl/ Halle Berry nude]
[http://heathergraham.enic.nl/ Heather Graham nude]
[http://jenniferaniston.enic.nl/ Jennifer Aniston nude]
[http://jenniferlopez.enic.nl/ Jennifer Lopez nude]
[http://jenniferhewitt.enic.nl/ Jennifer Love Hewitt nude]
[http://jessicasimpson.enic.nl/ Jessica Simpson nude]
[http://katehudson.enic.nl/ Kate Hudson nude]
[http://katieholmesnude.enic.nl/ Katie Holmes nude]
[http://keiraknightley.enic.nl/ Keira Knightley nude]
[http://kirstendunst.enic.nl/ Kirsten Dunst nude]
[http://kristannaloken.enic.nl/ Kristanna Loken nude]
[http://lindseylohan.enic.nl/ Lindsey Lohan nude]
[http://lindsaylohan.enic.nl/ Lindsay Lohan nude]
[http://alyssamilano.1stOK.com Alyssa Milano nude]
[http://angelinajolie.1stOK.com Angelina Jolie nude]
[http://annanicolesmith.1stOK.com Anna Nicole Smith nude]
[http://britneyspears.1stOK.com Britney Spears nude]
[http://camerondiaznude.1stOK.com Cameron Diaz nude]
[http://carmenelectra.1stOK.com Carmen Electra nude]
[http://charlizetheron.1stOK.com Charlize Theron nude]
[http://aguileranude.1stOK.com Christina Aguilera nude]
[http://demimoorenude.1stOK.com Demi Moore nude]
[http://deniserichards.1stOK.com Denise Richards nude]
[http://angelinajolie.ca.tt Angelina Jolie nude]
[http://alyssamilano.ca.tt Alyssa Milano nude]
[http://annanicolesannanicolesmith.ca.tt Anna Nicole Smith nude]
[http://britneyspears.ca.tt Britney Spears nude]
[http://camerondiaznude.ca.tt Cameron Diaz nude]
[http://drewbarrymore.ca.tt Drew Barrymore nude]
[http://berkleynude.ca.tt Elizabeth Berkley nude]
[http://gwynethpaltrow.ca.tt Gwyneth Paltrow nude]
[http://halleberrynude.ca.tt Halle Berry nude]
[http://heathergraham.ca.tt Heather Graham nude]
[http://ws05.home.sapo.pt/ Extreme Pee Pics]
[http://ws05.home.sapo.pt/drink-urine.html drink urine]
[http://ws05.home.sapo.pt/public-pee.html public pee]
[http://ws05.home.sapo.pt/girl-peeing.html girl peeing]
[http://ws05.home.sapo.pt/golden-shower.html golden shower]
[http://ws05.home.sapo.pt/pissing-pic.html pissing pic]
[http://alyssamilano.home.sapo.pt/ Mr. Skin - #1 Nude Celebrity Club]
[http://alyssamilano.home.sapo.pt/salma-hayek-nude-clip.html salma hayek nude clip]
[http://alyssamilano.home.sapo.pt/salma-hayek-desperado-nude.html salma hayek desperado nude]
[http://alyssamilano.home.sapo.pt/sexy-salma-hayek-nude.html sexy salma hayek nude]
[http://alyssamilano.home.sapo.pt/salma-hayek-nude-video-clip.html salma hayek nude video clip]
[http://alyssamilano.home.sapo.pt/free-nude-salma-hayek-gallery.html free nude salma hayek gallery]
[http://alyssamilano.home.sapo.pt/salma-hayek-frida-nude-pic.html salma hayek frida nude pic]
[http://alyssamilano.home.sapo.pt/sarah-michelle-gellar-nude-free.html sarah michelle gellar nude free]
[http://alyssamilano.home.sapo.pt/sarah-michelle-gellar-nude-celeb.html sarah michelle gellar nude celeb]
[http://alyssamilano.home.sapo.pt/sarah-michelle-gellar-nude-naked.html sarah michelle gellar nude naked]
[http://alyssamilano.home.sapo.pt/shannon-elizabeth-nude-pic.html shannon elizabeth nude pic]
[http://alyssamilano.home.sapo.pt/shannon-elizabeth-nude-photo.html shannon elizabeth nude photo]
[http://alyssamilano.home.sapo.pt/shannon-elizabeth-nude-clip.html shannon elizabeth nude clip]
[http://alyssamilano.home.sapo.pt/shannon-elizabeth-nude-scene.html shannon elizabeth nude scene]
[http://alyssamilano.home.sapo.pt/naked-nude-pic-of-shannon-elizabeth.html naked nude pic of shannon elizabeth]
[http://alyssamilano.home.sapo.pt/shannon-elizabeth-nude-american-pie.html shannon elizabeth nude american pie]
[http://alyssamilano.home.sapo.pt/shannon-elizabeth-nude-naked.html shannon elizabeth nude naked]
[http://alyssamilano.home.sapo.pt/shannon-elizabeth-free-nude-picture.html shannon elizabeth free nude picture]
[http://alyssamilano.home.sapo.pt/free-nude-photo-of-shannon-elizabeth.html free nude photo of shannon elizabeth]
[http://alyssamilano.home.sapo.pt/tara-reid-nude-pic.html tara reid nude pic]
[http://alyssamilano.home.sapo.pt/tara-reid-nude-picture.html tara reid nude picture]
[http://alyssamilano.home.sapo.pt/tara-reid-nude-photo.html tara reid nude photo]
[http://alyssamilano.home.sapo.pt/tara-reid-free-nude-pic.html tara reid free nude pic]
[http://alyssamilano.home.sapo.pt/tara-reid-nude-movie.html tara reid nude movie]
[http://alyssamilano.home.sapo.pt/tara-reid-nude-naked.html tara reid nude naked]
[http://alyssamilano.home.sapo.pt/tara-reid-fake-nude.html tara reid fake nude]
[http://alyssamilano.home.sapo.pt/tara-reid-nude-gallery.html tara reid nude gallery]
[http://ws06.home.sapo.pt/ Title: Wetscape]
[http://ws06.home.sapo.pt/pissing-movie.html pissing movie]
[http://ws06.home.sapo.pt/pissing-sex.html pissing sex]
[http://ws06.home.sapo.pt/peeing-pic.html peeing pic]
[http://ws06.home.sapo.pt/golden-rain.html golden rain]
[http://ws06.home.sapo.pt/tampon.html tampon]
[http://ws04.home.sapo.pt/ watersports lake]
[http://ws04.home.sapo.pt/watersports.html watersports]
[http://ws03.home.sapo.pt/ nightime urination]
[http://ws03.home.sapo.pt/urination.html urination]
[http://ws01.do.nu/ Alyssa Milano Angelina Jolie Anna Nicole Smith Britney Spears Cameron Diaz Carmen Electra Charlize Theron Christina Aguilera Demi Moore nude and naked picture gallery]
[http://ws02.do.nu/ Drew Barrymore nude, Elizabeth Berkley nude, Gwyneth Paltrow nude, Halle Berry nude, Heather Graham nude, Jennifer Aniston nude, Jennifer Lopez nude, Jennifer Love Hewitt nude, Jessica Alba nude, Jessica Simpson nude, Kate Hudson nude, Katie Holmes nude]
[http://ws03.do.nu/ Keira Knightley nude, Kirsten Dunst nude, Kristanna Loken nude, Lindsey Lohan nude, Mandy Moore nude, Melissa Joan Hart nude, Neve Campbell nude, Monica Bellucci nude, Natalie Portman nude, Nicole Kidman nude, Pamela Anderson nude, Paris Hilton nude]
[http://ws04.do.nu/ Penelope Cruz nude, Reese Witherspoon nude, Salma Hayek nude, Sarah Michelle Gellar nude, Shannon Elizabeth nude, Sharon Stone nude, Tara Reid nude, Uma Thurman nude, naked, picture, gallery, movie, scene, pic, image]
[http://lol.to/bbs.php?bbs=ws001 pissing]


</div>
Logging capabilities are currently available in ITK through very limited mechanism that involve the use of the following element
 
* itkWarningMacro
* itkExceptionMacro
* TextOutput
 
=== Advantages ===
 
* It is already there  :-)
* It is fully implemented using ITK classes. We have complete control over the code
* It is compact and easy to maintain
 
=== Drawbacks ===
 
The drawbacks of the current functionalities are
 
* The TextOutput is by default sent to an OutputWindow that lacks an event-loop. It is then usually the case that users/developers dont have a chance to look at the error messages because they are scrolled rapidly and there is no way to get them back.
* Messages are not send to files. Currently this could only be done by each developer creating a class deriving from the OutputWindow and redirecting the messages to a file.
* Level of granularity. The current approach only have "ERROR" messages that are thrown through exceptions and warning messages.
 
== Wish List of Logging Features ==
 
Here are the features that ITK developer would like to have available in a logging infrastructure
 
* Possibility of selecting the level of granularity at run time
* Possibility of sending logging messages to multiple destinations (files, sockets, console, GUI windows) some of them simultaneously
* Suitable for being used in multi-threaded environments.
* Possibility of selecting the objects that send logging messages
* Possibility of having multiple receivers for the messages. e.g. several Logger instances
* Formatting log messages in such a way that they can be sorted and greped later on
* Possibility of adding time stamps to the messages
* Integrate with ITK such that appropriate filters (optimizers, registrators) would provide a basic level of progress reporting that could be enabled/disabled at run-time.
 
* Minimize performance impacts on the applications being logged. (important for release version of applications)
* Possibility of limiting the size of a log file (for saving storage space)
* Possibility of aging log files (for archiving)
* Possibility of guaranteeing messages to be logged (important when messages are critical)
* Possibility of loading an XML setting file at run time (level of granularity, destinations, format, etc.)
* Possibility of having hierarchy of loggers and inheritance of settings (convenience of setting and managing loggers)
* Possibility of having logger ID and being able to get and designate a logger with a specified ID (logger-wise run-time setting is possible, not application-wise)
 
= Option of using Log4cxx =
 
[http://logging.apache.org/log4cxx/ log4cxx] is a logging package modeled on [http://logging.apache.org/log4j/docs/ log4j], a popular logging package for Java.
 
 
== Usage ==
Each class in ITK would have a static class variable pointing to a [http://logging.apache.org/log4cxx/manual/classlog4cxx_1_1Logger.html logger].  The logger's are named, with the usual naming convention being ''org.itk.Code.Common.Object'', essentially a namespace / Java package hybrid.  Names define a hierarchy, so ''org.itk.Code'' is the parent of ''org.itk.Code.Common'', ''org.itk.Code.BasicFilters'', etc...  There are different levels of log messages, '''debug''', '''info''', '''warn''', '''error''', '''fatal''' and '''log'''.  The developer decides when and where to put a logging message, and it's severity.
 
At runtime, the application defines the threshold of messages to be logged, ''i.e.'' '''debug''' and higher, or '''info''' and higher.  A logger inherits it's threshold from it's parent, if not specified.  Thus it is easy to shut off logging messages from ''org.itk.Code'' all at once.
 
In addition to thresholds, different output options are available called [http://logging.apache.org/log4cxx/manual/classlog4cxx_1_1Appender.html Appenders].  For instance:
* Console: essentially std::cout
* File: Log to a file
* SMTP: Send email
* RDBMS: Log to a database
* RollingLogFile: Log to a file, roll to a new file at specified time/size
Documentation can be found on the log4cxx [http://logging.apache.org/log4cxx/manual/index.html doxygen pages].
== Impact to ITK ==
* Augment the Error and Warning macros in ITK
* Can be implemented in New and/or Type macro
* Immediately available to all class developers
* Flexible output options
* Aid to debugging
 
== Pros ==
* Allow much more flexibility in logging messages
* Easy configuration of logging structure
* Applications can leverage feature
* Can change logging options at runtime, not compile time
 
== Cons ==
* Static class variable per class. Experience have proved Singletons to be conflictive when dealing with shared libraries.
* The library is in version 0.93. Its developers have gone through a refactoring process and the new version depends on a systems service library from Apache.
* 30K lines of code to maintain
* 2 Megabytes of source code
* It wasn't supported in all the ITK platforms. It required substantial work to port it to all of them.
* Need to work out default configuration
* Run-time overhead (fairly minimal)
 
== Proposed Plan ==
* Check into Insight/Utilities
* Write smoke test
* Get test working on all platforms
* Resolve integration issues (itkNewMacro / itkTypeMacro)
* Replace Error / Warning Macros
* Begin using in existing and new classes
 
 
= Option of Writing our own =
 
This option involves to develop a set of new ITK classes intended for providing the logging functionalities.
 
== Pros ==
 
* Complete control over the code
* Only implements what we need
* Focus on performance on the context of ITK uses
 
== Cons ==
 
* Potentially reinventing the wheeel
 
== Potential Implementations ==
 
=== Adapt IGSTK classes ===
 
Sohan Rajan from the ISIS Center at Georgetown University has already develop a starting framework for providing logging capabilities. We could take these classes and extend them as appropriate in order to fulfill the needs of the ITK community.
 
== Issues from Hee-Su(ISIS) ==
 
In addition to wish list update, here are some issues.
 
=== OS-independent timestamps ===
 
for datetime
* vtkTimerLog : better but it's dependent on vtk
* time(), strftime(), gmtime(), localtime(), asctime() : ANSI but 32bits
 
for real-time clock
* QueryPerformanceCounter(), QueryPerformanceFrequency() : Win32
* gettimeofday() : UNIX, Linux
 
=== Alternatives for guaranteeing messages to be logged ===
 
* flush to a disk immediately (slow, overhead on a disk)
* run a separate logging service and forward messages to it. (slow because of IPC)
* flush manually by a programmer
* flush automatically when the level of message is above certain level. (e.g. CRITICAL, ERROR)
* don't care (do nothing)
 
* user could set an option for this. but option checking(if-then) might reduce performance.
 
{{ITK/Template/Footer}}

Latest revision as of 19:26, 11 June 2007

Requirements

Current Status

Logging capabilities are currently available in ITK through very limited mechanism that involve the use of the following element

  • itkWarningMacro
  • itkExceptionMacro
  • TextOutput

Advantages

  • It is already there  :-)
  • It is fully implemented using ITK classes. We have complete control over the code
  • It is compact and easy to maintain

Drawbacks

The drawbacks of the current functionalities are

  • The TextOutput is by default sent to an OutputWindow that lacks an event-loop. It is then usually the case that users/developers dont have a chance to look at the error messages because they are scrolled rapidly and there is no way to get them back.
  • Messages are not send to files. Currently this could only be done by each developer creating a class deriving from the OutputWindow and redirecting the messages to a file.
  • Level of granularity. The current approach only have "ERROR" messages that are thrown through exceptions and warning messages.

Wish List of Logging Features

Here are the features that ITK developer would like to have available in a logging infrastructure

  • Possibility of selecting the level of granularity at run time
  • Possibility of sending logging messages to multiple destinations (files, sockets, console, GUI windows) some of them simultaneously
  • Suitable for being used in multi-threaded environments.
  • Possibility of selecting the objects that send logging messages
  • Possibility of having multiple receivers for the messages. e.g. several Logger instances
  • Formatting log messages in such a way that they can be sorted and greped later on
  • Possibility of adding time stamps to the messages
  • Integrate with ITK such that appropriate filters (optimizers, registrators) would provide a basic level of progress reporting that could be enabled/disabled at run-time.
  • Minimize performance impacts on the applications being logged. (important for release version of applications)
  • Possibility of limiting the size of a log file (for saving storage space)
  • Possibility of aging log files (for archiving)
  • Possibility of guaranteeing messages to be logged (important when messages are critical)
  • Possibility of loading an XML setting file at run time (level of granularity, destinations, format, etc.)
  • Possibility of having hierarchy of loggers and inheritance of settings (convenience of setting and managing loggers)
  • Possibility of having logger ID and being able to get and designate a logger with a specified ID (logger-wise run-time setting is possible, not application-wise)

Option of using Log4cxx

log4cxx is a logging package modeled on log4j, a popular logging package for Java.


Usage

Each class in ITK would have a static class variable pointing to a logger. The logger's are named, with the usual naming convention being org.itk.Code.Common.Object, essentially a namespace / Java package hybrid. Names define a hierarchy, so org.itk.Code is the parent of org.itk.Code.Common, org.itk.Code.BasicFilters, etc... There are different levels of log messages, debug, info, warn, error, fatal and log. The developer decides when and where to put a logging message, and it's severity.

At runtime, the application defines the threshold of messages to be logged, i.e. debug and higher, or info and higher. A logger inherits it's threshold from it's parent, if not specified. Thus it is easy to shut off logging messages from org.itk.Code all at once.

In addition to thresholds, different output options are available called Appenders. For instance:

  • Console: essentially std::cout
  • File: Log to a file
  • SMTP: Send email
  • RDBMS: Log to a database
  • RollingLogFile: Log to a file, roll to a new file at specified time/size

Documentation can be found on the log4cxx doxygen pages.

Impact to ITK

  • Augment the Error and Warning macros in ITK
  • Can be implemented in New and/or Type macro
  • Immediately available to all class developers
  • Flexible output options
  • Aid to debugging

Pros

  • Allow much more flexibility in logging messages
  • Easy configuration of logging structure
  • Applications can leverage feature
  • Can change logging options at runtime, not compile time

Cons

  • Static class variable per class. Experience have proved Singletons to be conflictive when dealing with shared libraries.
  • The library is in version 0.93. Its developers have gone through a refactoring process and the new version depends on a systems service library from Apache.
  • 30K lines of code to maintain
  • 2 Megabytes of source code
  • It wasn't supported in all the ITK platforms. It required substantial work to port it to all of them.
  • Need to work out default configuration
  • Run-time overhead (fairly minimal)

Proposed Plan

  • Check into Insight/Utilities
  • Write smoke test
  • Get test working on all platforms
  • Resolve integration issues (itkNewMacro / itkTypeMacro)
  • Replace Error / Warning Macros
  • Begin using in existing and new classes


Option of Writing our own

This option involves to develop a set of new ITK classes intended for providing the logging functionalities.

Pros

  • Complete control over the code
  • Only implements what we need
  • Focus on performance on the context of ITK uses

Cons

  • Potentially reinventing the wheeel

Potential Implementations

Adapt IGSTK classes

Sohan Rajan from the ISIS Center at Georgetown University has already develop a starting framework for providing logging capabilities. We could take these classes and extend them as appropriate in order to fulfill the needs of the ITK community.

Issues from Hee-Su(ISIS)

In addition to wish list update, here are some issues.

OS-independent timestamps

for datetime

  • vtkTimerLog : better but it's dependent on vtk
  • time(), strftime(), gmtime(), localtime(), asctime() : ANSI but 32bits

for real-time clock

  • QueryPerformanceCounter(), QueryPerformanceFrequency() : Win32
  • gettimeofday() : UNIX, Linux

Alternatives for guaranteeing messages to be logged

  • flush to a disk immediately (slow, overhead on a disk)
  • run a separate logging service and forward messages to it. (slow because of IPC)
  • flush manually by a programmer
  • flush automatically when the level of message is above certain level. (e.g. CRITICAL, ERROR)
  • don't care (do nothing)
  • user could set an option for this. but option checking(if-then) might reduce performance.



ITK: [Welcome | Site Map]