Hello;

earlier this autumn Andreas submitted a ParserLog class which has been used in 
the Parser for some time. I would now like to promote this to a general logging 
facility for OPM. I have thought quite a lot about it, but not implemented 
much[1]. I will share my thoughts below, and hope you will comment:


1.       The logging facility should be implemented as a singleton, i.e. it 
should not be necessary to pass in a reference to a log class to all 
methods/functions which might want to add a log message.

2.       The logging facility should be based on thin frontend and a collection 
of logging backends. That way we can have different backends active at the same 
time:


auto streamBackend = new LogStreamBackend( stdout );
auto emailBackend = new EmailBackend( ... );

OpmLog::addBackend( streamBackend );
OpmLog::addBackend( emailBackend );
....


3.       The log levels, i.e. Warning, Error and so on should be dynamic; and 
each backend should have it's own loglevel.

Joakim


[1]: The PR:  https://github.com/OPM/opm-parser/pull/385 is the very first 
step. When this has been merged the remaining work can be performed in the 
Parser without affecting the downstream modules before it is ready.

Joakim

RDI project with IT elements -> Contact R&D 
Toolbox<https://statoil.service-now.com/selfservice/catalog_item_detail.do?sysparm_document_key=sc_cat_item,78bfbbce6fb455001f6446916e3ee453>



-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you
_______________________________________________
Opm mailing list
Opm@opm-project.org
http://www.opm-project.org/mailman/listinfo/opm

Reply via email to