]> SALOME platform Git repositories - modules/kernel.git/blob - src/Logger/SALOME_Logger_Server.hxx
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/kernel.git] / src / Logger / SALOME_Logger_Server.hxx
1 //  SALOME Logger : CORBA server managing trace output
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
6 //
7 //  File   : SALOME_Logger_Server.hxx
8 //  Author : Vasily Rusyaev
9 //  Module : SALOME
10
11 #if !defined SALOME_Logger_Server_include
12 #define SALOME_Logger_Server_include
13
14 #include <SALOMEconfig.h>
15
16 #ifndef WNT
17 #include <fstream.h>
18 #else
19 #include <fstream>
20 #include <iosfwd>
21 #endif
22 #include <omnithread.h>
23 #include "Logger.hh"
24
25 #ifdef WNT
26 # if defined LOGGER_EXPORTS
27 #  define LOGGER_EXPORT __declspec( dllexport )
28 # else
29 #  define LOGGER_EXPORT __declspec( dllimport )
30 # endif
31 #else
32 # define LOGGER_EXPORT
33 #endif
34
35
36 class LOGGER_EXPORT Logger :
37   public POA_SALOME_Logger::Logger
38 {
39 public:
40         //constructor w/o parameters
41         //all messages will be put into terminal via cout
42         Logger();
43         //constructor with parameter, filename is output file
44         //all messages will be put into special file passed as parameter
45         Logger(const char *filename);
46         virtual ~Logger();
47         //put message into one special place for all servers
48         void putMessage(const char* message);
49         void ping();
50 private:
51         //if m_putIntoFile is true all messages will be put into special 
52         //otherwise all messages will be put into terminal via cout 
53         bool m_putIntoFile;
54         //ofstream class specialized for disk file output
55 #ifndef WNT
56         ofstream m_outputFile; 
57 #else
58                 std::ofstream m_outputFile; 
59 #endif
60         //synchronisation object
61         static omni_mutex myLock;
62 };
63
64 #endif // !defined(SALOME_Logger_Server_include)