-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|466|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Showcase Home -> Functions Libraries

HoboBen
Created : 21 September 2008
 
System : Windows
Language : Cobra

hlog

Hobo's Logging Library (Cobra)

Download v20080921
Online Documentation
I got fed up of re-writing the same logging library every time I started a new program, so I decided to make it into a proper unit.

Having a good debug logging system in your programs can be extremely useful in hunting down bugs and finding performance bottlenecks.

Instead of just appending text to a single file, this logging library uses Logging Contexts that can write to multiple files at once.

This can be really useful if you want to separate your error log from your debug log. Logging contexts makes it easy for any events that enter the error log to be automatically also be added to the debug log at the same time.

This library also supports both real-time logging and buffered logging.

Comments


Sunday, 21 September 2008, 01:34
Jayenkai
Good lord!
All that for a log!
You're really aiming to log stuff, aren't you!

Um. yeay!
Honestly debuglog / Log("")->log.txt generally does me fine.. And I usually don't even bother!
But I'm sure if I ever bothered to do a larger project (yeah, right!!) it'd be handy to log stuff.
Sunday, 21 September 2008, 02:32
HoboBen
Yep, call me crazy, but I usually manage to create 20 - 120kb of log files each time I run any of my projects... they're extremely helpful though, so it's definitely been worth the time to do a proper job of it.

Edit: You'd also be surprised at how the program flow often turns out quite a bit different to the understanding of it that you have in your head, and how good it is at making performance issues obvious.
Monday, 31 August 2009, 17:28
HoboBen
Updated: by switching from a string buffer to a list of strings, buffered logging is about five times faster in my tests.

Neat!