diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-27 16:35:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-27 16:35:07 +0100 |
commit | 2c6eb5dcadc77c4e6af0d03c69267859b1f853b5 (patch) | |
tree | 01e80385dd604e6714c171e026d8324caf1ec4e1 /include | |
parent | a70dd5c57b32bef0040daa92bbfa8c00a3bf22f2 (diff) |
remove ResourceBasedEventLogger in favor of its base EventLogger
because there are no resources in use anymore
Change-Id: I37e4a100aabbf6214533738da3e528ed2f434eae
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/logging.hxx | 125 |
1 files changed, 8 insertions, 117 deletions
diff --git a/include/comphelper/logging.hxx b/include/comphelper/logging.hxx index cd74d24d569a..0d71620e136d 100644 --- a/include/comphelper/logging.hxx +++ b/include/comphelper/logging.hxx @@ -118,6 +118,14 @@ namespace comphelper //- XLogger::log equivalents/wrappers //- string messages + /// logs a given message, without any arguments, or source class/method names + bool log( const sal_Int32 _nLogLevel, const OUString& rMessage ) const + { + if ( isLoggable( _nLogLevel ) ) + return impl_log(_nLogLevel, nullptr, nullptr, rMessage); + return false; + } + /** logs a given message, replacing a placeholder in the message with an argument The function takes, additionally to the log level and the message, an arbitrary @@ -468,123 +476,6 @@ namespace comphelper const OptionalString& _rArgument6 = OptionalString() ) const; }; - - - //= ResourceBasedEventLogger - - /** extends the EventLogger class with functionality to load log messages from - a resource bundle. - */ - class COMPHELPER_DLLPUBLIC ResourceBasedEventLogger : public EventLogger - { - public: - /** creates a resource based event logger - @param _rxContext - the component context for creating new components - @param _pAsciiLoggerName - the ASCII name of the logger to work with. If NULL, the office-wide - default logger will be used. - - */ - ResourceBasedEventLogger( - const css::uno::Reference< css::uno::XComponentContext >& _rxContext, - const sal_Char* _pAsciiLoggerName - ); - - //- XLogger::log equivalents/wrappers - //- resource IDs - - /// logs a given message, without any arguments, or source class/method names - bool log( const sal_Int32 _nLogLevel, const OUString& rMessage ) const - { - if ( isLoggable( _nLogLevel ) ) - return impl_log(_nLogLevel, nullptr, nullptr, rMessage); - return false; - } - - /** logs a given message, replacing a placeholder in the message with an argument - - The function takes, additionally to the log level and the message, an arbitrary - argument. This argument is converted to a string using an overloaded function - named <code>convertLogArgToString</code>. Then, a placeholder "$1$" - is searched in the message string, and replaced with the argument string. - */ - template< typename ARGTYPE1 > - bool log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1 ) const - { - if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, nullptr, nullptr, rMessage, - OptionalString( log::convert::convertLogArgToString( _argument1 ) ) ); - return false; - } - - /// logs a given message, replacing 2 placeholders in the message with respective values - template< typename ARGTYPE1, typename ARGTYPE2 > - bool log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const - { - if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, nullptr, nullptr, rMessage, - OptionalString( log::convert::convertLogArgToString( _argument1 ) ), - OptionalString( log::convert::convertLogArgToString( _argument2 ) ) ); - return false; - } - - /// logs a given message, replacing 3 placeholders in the message with respective values - template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 > - bool log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const - { - if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, nullptr, nullptr, rMessage, - OptionalString( log::convert::convertLogArgToString( _argument1 ) ), - OptionalString( log::convert::convertLogArgToString( _argument2 ) ), - OptionalString( log::convert::convertLogArgToString( _argument3 ) ) ); - return false; - } - - /// logs a given message, replacing 4 placeholders in the message with respective values - template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 > - bool log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const - { - if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, nullptr, nullptr, rMessage, - OptionalString( log::convert::convertLogArgToString( _argument1 ) ), - OptionalString( log::convert::convertLogArgToString( _argument2 ) ), - OptionalString( log::convert::convertLogArgToString( _argument3 ) ), - OptionalString( log::convert::convertLogArgToString( _argument4 ) ) ); - return false; - } - - /// logs a given message, replacing 5 placeholders in the message with respective values - template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 > - bool log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const - { - if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, nullptr, nullptr, rMessage, - OptionalString( log::convert::convertLogArgToString( _argument1 ) ), - OptionalString( log::convert::convertLogArgToString( _argument2 ) ), - OptionalString( log::convert::convertLogArgToString( _argument3 ) ), - OptionalString( log::convert::convertLogArgToString( _argument4 ) ), - OptionalString( log::convert::convertLogArgToString( _argument5 ) ) ); - return false; - } - - /// logs a given message, replacing 6 placeholders in the message with respective values - template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 > - bool log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const - { - if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, nullptr, nullptr, rMessage, - OptionalString( log::convert::convertLogArgToString( _argument1 ) ), - OptionalString( log::convert::convertLogArgToString( _argument2 ) ), - OptionalString( log::convert::convertLogArgToString( _argument3 ) ), - OptionalString( log::convert::convertLogArgToString( _argument4 ) ), - OptionalString( log::convert::convertLogArgToString( _argument5 ) ), - OptionalString( log::convert::convertLogArgToString( _argument6 ) ) ); - return false; - } - }; - - } // namespace comphelper |