LibreOffice Module connectivity (master) 1
ConnectionLog.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <com/sun/star/logging/LogLevel.hpp>
23
24#include <rtl/ustring.hxx>
25
26// Strange enough, GCC requires the following forward declarations of the various
27// convertLogArgToString flavors to be *before* the inclusion of comphelper/logging.hxx
28
30{
31 struct Date;
32 struct Time;
33 struct DateTime;
34}
35
36
38{
39
40
41 // helpers for logging more data types than are defined in comphelper/logging.hxx
42 OUString convertLogArgToString( const css::util::Date& _rDate );
43 OUString convertLogArgToString( const css::util::Time& _rTime );
44 OUString convertLogArgToString( const css::util::DateTime& _rDateTime );
45
46
47}
48
49
51
52namespace connectivity
53{
54 namespace LogLevel = css::logging::LogLevel;
55}
56
57
59
62 {
63 public:
65 {
69
71 };
72
73 private:
74 const sal_Int32 m_nObjectID;
75
76 public:
78 ConnectionLog( const ::comphelper::EventLogger & _rDriverLog );
80 ConnectionLog( const ConnectionLog& _rSourceLog );
82 ConnectionLog( const ConnectionLog& _rSourceLog, ObjectType _eType );
83
84 sal_Int32 getObjectID() const { return m_nObjectID; }
85
87 void log( const sal_Int32 _nLogLevel, const OUString& rMessage )
88 {
89 ConnectionLog_Base::log( _nLogLevel, rMessage, m_nObjectID );
90 }
91
92 template< typename ARGTYPE1 >
93 void log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1 ) const
94 {
95 ConnectionLog_Base::log( _nLogLevel, rMessage, m_nObjectID, _argument1 );
96 }
97
98 template< typename ARGTYPE1, typename ARGTYPE2 >
99 void log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
100 {
101 ConnectionLog_Base::log( _nLogLevel, rMessage, m_nObjectID, _argument1, _argument2 );
102 }
103
104 template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
105 void log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
106 {
107 ConnectionLog_Base::log( _nLogLevel, rMessage, m_nObjectID, _argument1, _argument2, _argument3 );
108 }
109
110 template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
111 void log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
112 {
113 ConnectionLog_Base::log( _nLogLevel, rMessage, m_nObjectID, _argument1, _argument2, _argument3, _argument4 );
114 }
115
116 template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
117 void log( const sal_Int32 _nLogLevel, const OUString& rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
118 {
119 ConnectionLog_Base::log( _nLogLevel, rMessage, m_nObjectID, _argument1, _argument2, _argument3, _argument4, _argument5 );
120 }
121 };
122
123
124} // namespace connectivity::java::sql
125
126
127/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void log(const sal_Int32 _nLogLevel, const OUString &rMessage) const
void log(const sal_Int32 _nLogLevel, const OUString &rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5) const
void log(const sal_Int32 _nLogLevel, const OUString &rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3) const
void log(const sal_Int32 _nLogLevel, const OUString &rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4) const
void log(const sal_Int32 _nLogLevel, const OUString &rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2) const
void log(const sal_Int32 _nLogLevel, const OUString &rMessage, ARGTYPE1 _argument1) const
ConnectionLog(const ::comphelper::EventLogger &_rDriverLog)
will construct an instance of ObjectType CONNECTION
void log(const sal_Int32 _nLogLevel, const OUString &rMessage)
logs a given message, without any arguments, or source class/method names
const OUString & convertLogArgToString(const OUString &_rValue)
::comphelper::EventLogger ConnectionLog_Base