diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-08-31 14:01:10 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-08-31 14:01:10 +0000 |
commit | 3be99be771437ded721158dad8f01ac44a762d40 (patch) | |
tree | 8f6c379f25bdedec864a975ba6735d9f89675979 /configmgr | |
parent | 7d0f4941d7793e0d3f2d71fedbb6b3eca3d1edf0 (diff) |
INTEGRATION: CWS cfglogging (1.1.2); FILE ADDED
2004/08/27 17:10:43 jb 1.1.2.1: #i25940# A logger for testing log output
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/workben/logger/simplelogger.hxx | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/configmgr/workben/logger/simplelogger.hxx b/configmgr/workben/logger/simplelogger.hxx new file mode 100644 index 000000000000..e4b2ddb816e6 --- /dev/null +++ b/configmgr/workben/logger/simplelogger.hxx @@ -0,0 +1,97 @@ +#ifndef CONFIGMGR_SIMPLELOGGER_HXX_ +#define CONFIGMGR_SIMPLELOGGER_HXX_ + +#include "simplelogger.hxx" + +#ifndef _COM_SUN_STAR_UTIL_LOGGING_XLOGGER_HPP_ +#include <com/sun/star/util/logging/XLogger.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif // _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ + +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif + +#include <stdio.h> + +namespace logger { + +namespace uno = com::sun::star::uno ; +namespace lang = com::sun::star::lang ; +namespace logging = com::sun::star::util::logging ; +using rtl::OUString; + +typedef cppu::WeakImplHelper2< logging::XLogger, + lang::XServiceInfo> LoggerBase ; + + +/** + Class implementing the Logger service + */ +class SimpleLogger : public LoggerBase +{ +public : + /** + Service constructor from a service factory. + + @param xContext component context + */ + explicit + SimpleLogger( const uno::Reference<uno::XComponentContext>& xContext, char const * name) ; + + /** Destructor */ + ~SimpleLogger() ; + + // XLogger + virtual uno::Reference< logging::XLogger > SAL_CALL + getLogger( const OUString& name ) + throw (uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getLevel( ) throw (uno::RuntimeException); + virtual OUString SAL_CALL getName( ) throw (uno::RuntimeException); + virtual sal_Bool SAL_CALL isLoggable( sal_Int32 level ) throw (uno::RuntimeException); + + virtual void SAL_CALL + logp( sal_Int32 level, const OUString& sourceClass, const OUString& sourceMethod, const OUString& msg ) + throw (uno::RuntimeException); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw (uno::RuntimeException) ; + + virtual sal_Bool SAL_CALL supportsService( const OUString& aServiceName) + throw (uno::RuntimeException) ; + + virtual uno::Sequence<OUString> SAL_CALL + getSupportedServiceNames(void) throw (uno::RuntimeException) ; + + /** + Provides the implementation name. + + @return implementation name + */ + static OUString SAL_CALL getImplementationName_static() ; + /** + Provides the list of supported services. + + @return list of service names + */ + static uno::Sequence<OUString> SAL_CALL getSupportedServiceNames_static() ; + +private: + /** Component Context */ + uno::Reference<uno::XComponentContext> mContext ; + OUString mName; + FILE * mOutput; + sal_Int32 mLevel; +} ; + +} // namespace logger + +#endif |