1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // ULogger output plug-in interface
24 #ifndef ULOGGEROUTPUTPLUGIN_H
25 #define ULOGGEROUTPUTPLUGIN_H
28 #include "uloggerplugin.h"
29 #include "uloggerdatatypes.h"
34 //! Abstract class for ULogger output plug-ins.
36 A ULogger output plug-in is responsible for writing Trace log data to some
37 output medium. Examples for output media are files, serial ports or TCP sockets.
38 Whenever ULogger needs to output Trace log data, it passes this to the currently
39 selected output plug-in, which then handles the actual writing to an output
42 All output plug-ins must derive from this class in order to be compatible with
43 ULogger. They must also derive from ULogger::CPlugin (whose header is already
44 included by this header, for convenience) in order to be compatible with the
45 ECom framework, which ULogger uses to load its output plug-ins.
51 Writes the given data to the output media that is represented by the
52 plug-in implementation. This method is called by ULogger whenever Trace log
53 data becomes available. How much data is passed to this function depends
54 on how ULogger is configured; the length of the given descriptor
55 indicates the size of the data packet. The intervals at which
56 this method is called depends on the amount of Trace data that is logged
57 from code in the currently running processes.
59 @param aData the Trace data to output, in BTrace format
60 @return KErrNone, if successful; otherwise one of the other system wide
63 virtual TInt Write(const TDesC8& aData) = 0;
66 Called by ULogger as first method after construction or after changes in
67 config file. This allows the output plug-in to initialize itself with its
70 @param aConfigs actual configurations valid for this instance
71 @return KErrNone, if successful; otherwise one of the other system wide
74 virtual TInt ConfigureOutputPlugin(const RPointerArray<TPluginConfiguration>& aConfigs) = 0;
77 Called by ULogger to indicate that the output plug-in must flush all buffers
78 and release any locked resources. Any resources may be locked only after any
79 other method is called.
81 virtual void CloseOutputPlugin() = 0;
83 /** Virtual destructor. */
84 virtual ~MOutputPlugin(){}
87 Output plug-in interface id. This is for ULogger to distinguish between the
88 different types of plug-ins (e.g. Output vs Input plug-ins).
90 static const CPlugin::TPluginInterface iInterfaceId = CPlugin::EOutput;
95 #endif // ULOGGEROUTPUTPLUGIN_H