summaryrefslogtreecommitdiff
path: root/src/old/multilogchannel.h
blob: d891a653e9cfb61111c201ff41d620c0639a157c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef MULTILOGCHANNEL_H
#define MULTILOGCHANNEL_H

#include "multilog.h"

/**
 * The baseclass for any MultiLog output channel.  Any class that implements
 * all of these functions can be put in the log chain and will be sent
 * messages from active MultiLoggers.
 *@author Mike Buland
 */
class MultiLogChannel
{
public:
	/**
	 * Deconstruct a MultiLogChannel.
	 */
	virtual ~MultiLogChannel() {};

	/**
	 * Should perform any operations that need to take place in order to start
	 * the output of data into this channel.  This will be called once by the
	 * MultiLog when the MultiLogChannel is registered.
	 *@returns True means that everything can go as planned.  False means that
	 * the MultiLog should remove this channel from the list and delete it.
	 */
	virtual bool openLog() = 0;

	/**
	 * Should append a log entry to the long, by whatever means are necesarry.
	 *@param pEntry The LogEntry to append.
	 *@returns True means that everything can go as planned.  False means that
	 * the MultiLog should remove this channel from the list and delete it.
	 */
	virtual bool append( MultiLog::LogEntry *pEntry ) = 0;

	/**
	 * Should perform any operations that need to take place in order to safely
	 * close and cleanup the log.
	 *@returns True means that everything can go as planned.  False means that
	 * the MultiLog should remove this channel from the list and delete it.
	 */
	virtual bool closeLog() = 0;
};

#endif