File: dserverlog.cpp

package info (click to toggle)
tango 9.2.5a%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 21,624 kB
  • ctags: 11,597
  • sloc: cpp: 135,480; sh: 21,772; makefile: 1,103; ansic: 1,083; java: 215; python: 55
file content (197 lines) | stat: -rw-r--r-- 7,019 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
static const char *RcsId = "$Id: dserverlog.cpp 27410 2015-01-27 05:46:17Z taurel $\n$Name$";

//+=============================================================================
//
// file :         DServerLog.cpp
//
// description :  Implementation of the DServer logging oriented commands
//
// project :      TANGO
//
// author(s) :    N.Leclercq - SOLEIL
//
// Copyright (C) :      2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015
//						European Synchrotron Radiation Facility
//                      BP 220, Grenoble 38043
//                      FRANCE
//
// This file is part of Tango.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Tango.  If not, see <http://www.gnu.org/licenses/>.
//
// $Revision: 27410 $
//
// $Log$
// Revision 3.7  2010/09/09 13:45:22  taurel
// - Add year 2010 in Copyright notice
//
// Revision 3.6  2010/06/18 07:45:47  taurel
// - In case of locked device, polling and logging related commands are
// allowed only for the locker process
//
// Revision 3.5  2009/01/21 12:49:04  taurel
// - Change CopyRights for 2009
//
// Revision 3.4  2008/10/06 15:01:09  taurel
// - Changed the licensing info from GPL to LGPL
//
// Revision 3.3  2008/10/03 06:52:31  taurel
// - Add some licensing info in each files
//
// Revision 3.2  2003/05/28 14:55:09  taurel
// Add the include (conditionally) of the include files generated by autoconf
//
// Revision 3.1  2003/05/16 08:46:16  taurel
// Many changes for release 3.0.1. The most important ones are :
// - Timeout are backs
// - Multiple db servers (change in TANGO_HOST syntax)
// - Added methods to print DeviceData, DeviceDataHistory, DeviceAttribute and DeviceAttributeHistory instances
// - Attributes name stored in blackbox
// - Remove check if a class is created without any device
// - It's now possible to create a DeviceProxy from its alias name
// - Command, attribute names are case insensitive
// - Change parameters of some DeviceProxy logging methods
// - Change parameters of DeviceProxy asynchronous replies calls
// - New serialization model in device server (no serialization model)
// - Win32 (2000) device server service does not exit at loggoff anymore
// - Miscellaneous bug fixes
//
// Revision 3.0  2003/03/25 16:43:20  taurel
// Many changes for Tango release 3.0 including
// - Added full logging features
// - Added asynchronous calls
// - Host name of clients now stored in black-box
// - Three serialization model in DS
// - Fix miscellaneous bugs
// - Ported to gcc 3.2
// - Added ApiUtil::cleanup() and destructor methods
// - Some internal cleanups
// - Change the way how TangoMonitor class is implemented. It's a recursive
//   mutex
//
// Revision 2.2  2003/03/11 17:55:53  nleclercq
// Switch from log4cpp to log4tango
//
// Revision 2.1  2003/02/17 14:57:41  taurel
// Added the new Tango logging stuff (Thanks Nicolas from Soleil)
//
//-=============================================================================

#if HAVE_CONFIG_H
#include <ac_config.h>
#endif

#include <tango.h>

#ifdef TANGO_HAS_LOG4TANGO

namespace Tango
{
//+----------------------------------------------------------------------------
//
// method : DServer::add_logging_target
//
//-----------------------------------------------------------------------------
void DServer::add_logging_target (const Tango::DevVarStringArray *argin)
{
  	NoSyncModelTangoMonitor mon(this);
  	cout4 << "Entering DServer::add_logging_target" << endl;
  	Logging::add_logging_target(argin);
  	cout4 << "Leaving DServer::add_logging_target" << endl;
}

//+----------------------------------------------------------------------------
//
// method : DServer::remove_logging_target
//
//-----------------------------------------------------------------------------
void DServer::remove_logging_target (const Tango::DevVarStringArray *argin)
{
  	NoSyncModelTangoMonitor mon(this);
  	cout4 << "Entering DServer::remove_logging_target" << endl;
  	Logging::remove_logging_target(argin);
  	cout4 << "Leaving DServer::remove_logging_target" << endl;
}

//+----------------------------------------------------------------------------
//
// method : DServer::get_logging_target
//
//-----------------------------------------------------------------------------
Tango::DevVarStringArray* DServer::get_logging_target (const std::string& dev_name)
{
  	NoSyncModelTangoMonitor mon(this);
  	cout4 << "Entering DServer::get_logging_target" << endl;
  	DevVarStringArray* res = Logging::get_logging_target(dev_name);
  	cout4 << "Leaving DServer::get_logging_target" << endl;
  	return res;
}

//+----------------------------------------------------------------------------
//
// method : DServer::set_logging_level
//
//-----------------------------------------------------------------------------
void DServer::set_logging_level (const Tango::DevVarLongStringArray *argin)
{
  	NoSyncModelTangoMonitor mon(this);
  	cout4 << "Entering DServer::set_logging_level" << endl;
  	Logging::set_logging_level(argin);
  	cout4 << "Leaving DServer::set_logging_level" << endl;
}

//+----------------------------------------------------------------------------
//
// method : DServer::get_logging_level
//
//-----------------------------------------------------------------------------
DevVarLongStringArray* DServer::get_logging_level (const DevVarStringArray *argin)
{
  	NoSyncModelTangoMonitor mon(this);
  	cout4 << "Entering DServer::get_logging_level" << endl;
  	DevVarLongStringArray* res = Logging::get_logging_level(argin);
  	cout4 << "Leaving DServer::get_logging_level" << endl;
  	return res;
}

//+----------------------------------------------------------------------------
//
// method : DServer::stop_logging
//
//-----------------------------------------------------------------------------
void  DServer::stop_logging (void)
{
  	NoSyncModelTangoMonitor mon(this);
  	cout4 << "Entering DServer::stop_logging" << endl;
  	Logging::stop_logging();
  	cout4 << "Leaving DServer::stop_logging" << endl;
}

//+----------------------------------------------------------------------------
//
// method : DServer::start_logging
//
//-----------------------------------------------------------------------------
void  DServer::start_logging (void)
{
  	NoSyncModelTangoMonitor mon(this);
  	cout4 << "Entering DServer::start_logging" << endl;
  	Logging::start_logging();
  	cout4 << "Leaving DServer::start_logging" << endl;
}


} // End of Tango namespace

#endif // TANGO_HAS_LOG4TANGO