mardi 13 juin 2017

Common Logger using C/C++ to cater to different types of log

I have a set of tools written in C/C++. Say there are 26 tools Tool A, Tool B,,, Tool Z. Each tool outputs logs in one or all of these formats, like HTML or CSv TSV, XML. Point to note is that say if a Tool "X" outputs 3 logs X.CSV, X.html , X.TSV and X.xml , here the same information is represented in all 4 file formats.

Currently all my 26 tools have their own custom logger implementation. I want to write a common LOgger library which would expose some common interfaces/APIs like say :

COnfigureAPI()
StartLogginginHTML()
StartLogginginXML()
StartLogginginCSV()

..... etc..

I was looking for some suggesstions if it would be helpful to use any design pattern here. I can only code in C or C++. Obviously C++ would be the choice so i can use OOPs to simplify the design.

Any suggesstion on how to design the common logger would be helpful ?

Aucun commentaire:

Enregistrer un commentaire