2012-07-10 15:14:45 +02:00
|
|
|
#ifndef STREAMLOGGER_H
|
|
|
|
#define STREAMLOGGER_H
|
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A logger that logs to stdout.
|
|
|
|
*/
|
2012-07-27 16:05:02 +02:00
|
|
|
class I2_BASE_API StreamLogger : public ILogger
|
2012-07-10 15:14:45 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef shared_ptr<StreamLogger> Ptr;
|
|
|
|
typedef weak_ptr<StreamLogger> WeakPtr;
|
|
|
|
|
2012-07-27 16:05:02 +02:00
|
|
|
StreamLogger(void);
|
|
|
|
StreamLogger(std::ostream *stream);
|
2012-07-10 15:14:45 +02:00
|
|
|
~StreamLogger(void);
|
|
|
|
|
2012-08-02 09:38:08 +02:00
|
|
|
void OpenFile(const String& filename);
|
2012-07-10 15:14:45 +02:00
|
|
|
protected:
|
|
|
|
virtual void ProcessLogEntry(const LogEntry& entry);
|
|
|
|
|
|
|
|
private:
|
|
|
|
ostream *m_Stream;
|
|
|
|
bool m_OwnsStream;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* STREAMLOGGER_H */
|