ffead.server.doc
DLogger.h
1 /*
2  Copyright 2009-2012, Sumeet Chhetri
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 /*
17  * DLogger.h
18  *
19  * Created on: Sep 5, 2009
20  * Author: sumeet
21  */
22 
23 #ifndef DLOGGER_H_
24 #define DLOGGER_H_
25 #include "PropFileReader.h"
26 #include "DateFormat.h"
27 #include "Mutex.h"
28 class DLogger {
29 public:
30  static DLogger* getDLogger();
31  static void info(string);
32  static void debug(string);
33  static void error(string);
34  static void init();
35  static void init(string file);
36  static void init(string level,string mode,string file);
37 private:
38  virtual ~DLogger();
39  DLogger();
40  DLogger(string);
41  DLogger(string,string,string);
42  DateFormat datFormat;
43  string level;
44  string mode;
45  string filepath;
46  ofstream out;
47  void write(string,string);
48  Mutex p_mutex;
49  static DLogger* m_pInstance;
50 };
51 
52 #endif /* DLOGGER_H_ */