Reading List

The Selfish Gene
The Psychopath Test: A Journey Through the Madness Industry
Bad Science
The Feynman Lectures on Physics
The Theory of Everything: The Origin and Fate of the Universe


ifknot's favorite books »

Monday 13 January 2014

Part (1/3): I'm a Lumberjack and I'm okay.


"Logging is a critical technique for troubleshooting and maintaining software systems."[1]

I would also add that logging is a critical technique for recording a variety of metrics when conducting software analysis and experimentation.

Therefore, I need a thread-safe, asynchronous and fast data serializing framework-not only in order to develop libfbp but also to experiment with it.

There are some great libraries out there already[2] but where's the fun and learning in that?




Strategy:

  • An easy to use, fast and versatile logger that works well with FBP programming and libfbp in particular.

Tactics:

  • thread-safe
  • asynchronous
  • fungible

In fact I already have a logging tool shlogger (a.k.a. shitty-logger) that I have shlepped around for many years. It is a dreadful monstrosity of accumulated macro cruft![3] Hence...

Golden rule:

  • no macros

Method:

  • thread-safe - C++11 mutexes[4] std::lock_guard<std::mutex>[5,6]
  • asynchronous - active objects[7] (All hail the Herb!)
  • fungible - template policies[8,9,10] (May the Andrescu be with you.)
  • switch off-and-on-able with null_log_policy (no #define)

References:

[1] http://www.drdobbs.com/cpp/logging-in-c/201804215?pgno=4
[2] http://www.codeproject.com/Articles/288827/g2log-An-efficient-asynchronous-logger-using-Cplus
[3] http://www.outpost9.com/reference/jargon/jargon_18.html#TAG393
[4] http://stackoverflow.com/questions/866837/plural-form-of-word-mutex
[5] http://en.cppreference.com/w/cpp/thread/mutex
[6] http://en.cppreference.com/w/cpp/thread/lock_guard
[7] http://www.drdobbs.com/parallel/prefer-using-active-objects-instead-of-n/225700095?pgno=2
[8] http://en.wikipedia.org/wiki/Policy-based_design
[9] http://www.drdobbs.com/cpp/a-lightweight-logger-for-c/240147505
[10] http://stackoverflow.com/questions/8337300/c11-how-do-i-implement-convenient-logging-without-a-singleton
link

No comments:

Post a Comment