rlog

rlog provides a message logging facility for C++.

You can find the project home for rlog at https://code.google.com/p/rlog/. Download the appropriate file and unpack, perhaps into your home directory. Create an environment variable for RLOG_HOME. Here’s an example:

 
export RLOG_HOME=/home/jeff/rlog-1.4

Under Ubuntu, you can build rlog using the following commands:

 
cd $RLOG_HOME
 
./configure
 
make

Under OS X, I was able to compile rlog only after applying a patch. See https://code.google.com/p/rlog/issues/detail?id=7 for information about the issue as well as the patch code. I used the code provided in the third comment (“This smaller diff...”). You can also find this patch code in the source distribution as code/wav/1/rlog.diff.

To apply the patch and build rlog, do the following:

 
cd $RLOG_HOME
 
patch -p1 [path to file]/rlog.diff
 
autoreconf
 
./configure
 
cp /opt/local/bin/glibtool libtool
 
make
 
sudo make install

The configure command copies a binary named libtool into the rlog directory, but it is not the binary that rlog expects. The command that copies glibtool atop libtool should correct this problem.

If the patch does not work for you, you can try making manual modifications. In the file $RLOG_HOME/rlog/common.h.in, you will find the following line:

 
# define RLOG_SECTION __attribute__ (( section("RLOG_DATA") ))

Replace that line with the following:

 
#ifdef _APPLE_
 
# define RLOG_SECTION __attribute__ (( section("__DATA, RLOG_DATA") ))
 
#else
 
# define RLOG_SECTION __attribute__ (( section("RLOG_DATA") ))
 
#endif

If you still have problems building rlog (it’s quite the challenge under both MacOS and Windows), don’t worry. When working through the legacy code example, skip ahead to Creating a Test Double for rlog, where you’ll learn how to get rlog out of the mix entirely.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.194.123