Posted on 2006-07-13
In my processing function, depending upon the activity code , we do some processing for different activities . We need to implement logging now. Depending upon the activity code, the data that needs to log would vary.
for ex activity code 01 , log field 1 and field 2
for activity code 02, log field 2 and field 5.
I need some ideas to implement this logging mechanism.
Is it best to have a base logging class and then derive classes out of it for each and every activity code . the derived classes would have data members specific to what it needs to log and a overridenn method persistlog in all the classes would write all of its data members to the disk.
is there any design pattern examples / code that accomplishes some thing like this ?
Thanks for ur help