23.11.2012 Views

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

The FEE Server Control Engine of the ALICE-TRD - Westfälische ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5 <strong>The</strong> <strong>FEE</strong><strong>Server</strong> <strong>Control</strong> <strong>Engine</strong><br />

at <strong>the</strong> end <strong>of</strong> <strong>the</strong> message. LogBufferManager contains a list <strong>of</strong> pointers to all output channels.<br />

<strong>The</strong> function sync(void) loops through <strong>the</strong> list and calls <strong>the</strong> function void sync(string<br />

message, string source, loglevel) <strong>of</strong> each output channel. <strong>The</strong>se sync functions decide depending<br />

on <strong>the</strong> loglevel if <strong>the</strong> message should be printed out and do <strong>the</strong> actual output.<br />

All classes for <strong>the</strong> different output channel types are derived from <strong>the</strong> abstract class<br />

LogBuffer. At <strong>the</strong> moment <strong>the</strong>re are four different output classes available. <strong>The</strong> class<br />

CoutLogBuffer provides an interface to STDOUT, <strong>the</strong> class FileLogBuffer writes <strong>the</strong> log messages<br />

to a file, <strong>the</strong> class SyslogLogBuffer prints it out to <strong>the</strong> Linux logging system and <strong>the</strong><br />

class ODimLogBuffer publishes <strong>the</strong> log messages via <strong>the</strong> <strong>FEE</strong><strong>Server</strong> to <strong>the</strong> DIM system.<br />

Even though <strong>the</strong> system is quite complex <strong>the</strong> usage is simple. During <strong>the</strong> initialization<br />

<strong>of</strong> <strong>the</strong> control engine one DIM logging channel and one syslog channel are created. <strong>The</strong><br />

syntax for <strong>the</strong> DIM channel is for example tlog .addStream("dimlog", new ODimLogBuffer(<br />

einfo));. <strong>The</strong> parameter dimlog is <strong>the</strong> name <strong>of</strong> <strong>the</strong> channel and used to identify <strong>the</strong> channel.<br />

<strong>The</strong> second parameter ODimLogBuffer(edebug) specifies <strong>the</strong> type <strong>of</strong> <strong>the</strong> new channel and<br />

<strong>the</strong> log level <strong>of</strong> this channel. <strong>The</strong> syntax for <strong>the</strong> syslog channel is <strong>the</strong> same. After <strong>the</strong><br />

initialization <strong>of</strong> <strong>the</strong> two channels, <strong>the</strong> command tlog

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!