Discussion Locked

Analyze your log files in reverse

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
The Jan 8, C++ TechMail discusses reversing logs to make your debugging easier. What methods do you use to analyze logs when debugging your applications?

3 replies

by cesar_duenas

If all you want is print a text file in reverse order, there are much simpler solutions:

In Unix, simply use:

tail -r mylogfile.log

A Perl script offers a more general solution

perl -e 'print reverse <>' mylogfile.log

Much better than a 100+ lines of C++ code!

Regards,

Cesar Duenas

by john torjo

You're right.

However, it can be compiled, and passed on to somebody else without needing any other interpreter (or the like) to be running on the other computer. It's especially useful for Win32 systems.

You could consider this as an example of using STL streams!

Best,
John

by lmolina_oops

I wrote a utility where I needed just the last
3000 of some "log" files. It was for a Windows
consolole tool, and in that environment you can depend on Unix toos or Perl binaries to be around.
You definitely would like something like this to be available. Although, I used one provided to me by other developer, written in "C", very fast indeed.

This discussion is closed to new replies.