update dev300-m58
[ooovba.git] / configmgr / workben / logger / simplelogger.hxx
blobaa711a8d681b4c3a2c9b1f650651bf764719d6d7
1 #ifndef CONFIGMGR_SIMPLELOGGER_HXX_
2 #define CONFIGMGR_SIMPLELOGGER_HXX_
4 #include "simplelogger.hxx"
5 #include <com/sun/star/util/logging/XLogger.hpp>
6 #include <com/sun/star/lang/XServiceInfo.hpp>
7 #include <com/sun/star/uno/XComponentContext.hpp>
8 #include <cppuhelper/implbase2.hxx>
10 #include <stdio.h>
12 namespace logger {
14 namespace uno = com::sun::star::uno ;
15 namespace lang = com::sun::star::lang ;
16 namespace logging = com::sun::star::util::logging ;
17 using rtl::OUString;
19 typedef cppu::WeakImplHelper2< logging::XLogger,
20 lang::XServiceInfo> LoggerBase ;
23 /**
24 Class implementing the Logger service
26 class SimpleLogger : public LoggerBase
28 public :
29 /**
30 Service constructor from a service factory.
32 @param xContext component context
34 explicit
35 SimpleLogger( const uno::Reference<uno::XComponentContext>& xContext, char const * name) ;
37 /** Destructor */
38 ~SimpleLogger() ;
40 // XLogger
41 virtual uno::Reference< logging::XLogger > SAL_CALL
42 getLogger( const OUString& name )
43 throw (uno::RuntimeException);
45 virtual sal_Int32 SAL_CALL getLevel( ) throw (uno::RuntimeException);
46 virtual OUString SAL_CALL getName( ) throw (uno::RuntimeException);
47 virtual sal_Bool SAL_CALL isLoggable( sal_Int32 level ) throw (uno::RuntimeException);
49 virtual void SAL_CALL
50 logp( sal_Int32 level, const OUString& sourceClass, const OUString& sourceMethod, const OUString& msg )
51 throw (uno::RuntimeException);
53 // XServiceInfo
54 virtual OUString SAL_CALL getImplementationName()
55 throw (uno::RuntimeException) ;
57 virtual sal_Bool SAL_CALL supportsService( const OUString& aServiceName)
58 throw (uno::RuntimeException) ;
60 virtual uno::Sequence<OUString> SAL_CALL
61 getSupportedServiceNames(void) throw (uno::RuntimeException) ;
63 /**
64 Provides the implementation name.
66 @return implementation name
68 static OUString SAL_CALL getImplementationName_static() ;
69 /**
70 Provides the list of supported services.
72 @return list of service names
74 static uno::Sequence<OUString> SAL_CALL getSupportedServiceNames_static() ;
76 private:
77 /** Component Context */
78 uno::Reference<uno::XComponentContext> mContext ;
79 OUString mName;
80 FILE * mOutput;
81 sal_Int32 mLevel;
82 } ;
84 } // namespace logger
86 #endif