Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[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 //
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 <fstream.h>
15 #include <omnithread.h>
16 #include "Logger.hh"
17
18 class Logger :
19   public POA_SALOME_Logger::Logger,
20   public PortableServer::RefCountServantBase 
21 {
22 public:
23         //constructor w/o parameters
24         //all messages will be put into terminal via cout
25         Logger();
26         //constructor with parameter, filename is output file
27         //all messages will be put into special file passed as parameter
28         Logger(const char *filename);
29         virtual ~Logger();
30         //put message into one special place for all servers
31         void putMessage(const char* message);
32         void ping();
33 private:
34         //if m_putIntoFile is true all messages will be put into special 
35         //otherwise all messages will be put into terminal via cout 
36         bool m_putIntoFile;
37         //ofstream class specialized for disk file output
38         ofstream m_outputFile; 
39         //synchronisation object
40         static omni_mutex myLock;
41 };
42
43 #endif // !defined(SALOME_Logger_Server_include)