1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SALOME Logger : CORBA server managing trace output
23 // File : SALOME_Trace.cxx
24 // Author : Vasily Rusyaev
27 #if !defined(AFX_LOGGER_H__96F2A3AB_F6F8_11D6_BFA6_000476A0958C__INCLUDED_)
28 #define AFX_LOGGER_H__96F2A3AB_F6F8_11D6_BFA6_000476A0958C__INCLUDED_
31 #include <SALOMEconfig.h>
34 //these declarations for files don't using OCC includes (for example HDF)
37 # ifndef Standard_EXPORT
38 # define Standard_EXPORT __declspec( dllexport )
39 // For global variables :
40 # define Standard_EXPORTEXTERN __declspec( dllexport ) extern
41 # define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport )
42 # endif /* Standard_EXPORT */
44 # ifndef Standard_IMPORT
45 # define Standard_IMPORT __declspec( dllimport ) extern
46 # define Standard_IMPORTC extern "C" __declspec( dllimport )
47 # endif /* Standard_IMPORT */
51 # ifndef Standard_EXPORT
52 # define Standard_EXPORT
53 // For global variables :
54 # define Standard_EXPORTEXTERN extern
55 # define Standard_EXPORTEXTERNC extern "C"
56 # endif /* Standard_EXPORT */
58 # ifndef Standard_IMPORT
59 # define Standard_IMPORT extern
60 # define Standard_IMPORTC extern "C"
61 # endif /* Standard_IMPORT */
65 class SALOME_Trace : public std::ostrstream
68 virtual ~SALOME_Trace();
69 static Standard_EXPORT SALOME_Trace& Instance();
70 // initializes Logger (if USE_LOGGER variable is set) and returns true, in case success
71 int Initialize(CORBA::ORB_ptr theOrb);
72 Standard_EXPORT void putMessage(std::ostream& msg);
74 //disable creation of instances. It's necessary to use static SALOME_Logger& Instance()
76 SALOME_Logger::Logger_var m_pInterfaceLogger;// object reference on Logger server.
80 #define GLogger SALOME_Trace::Instance()
82 #endif // !defined(AFX_LOGGER_H__96F2A3AB_F6F8_11D6_BFA6_000476A0958C__INCLUDED_)