areaDetector  3-5-0
EPICS areaDetector framework
logfile.h
Go to the documentation of this file.
1 
10 /*
11  * Include files.
12  */
13 
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <string.h>
17 
18 #include <shareLib.h>
19 
20 //let logfile.cpp use asynPrint instead of printf
21 #ifdef LOGFILE_USE_ASYN
22 #include "asynDriver.h"
23 #endif
24 
25 /*
26  * Double incluson protection.
27  */
28 #ifndef _LOG_FILE_H
29 #define _LOG_FILE_H
30 
38 class epicsShareClass log_file {
39  public:
40  // make file object.
41  log_file(char* filename);
42 
43  // destroy file object.
44  ~log_file();
45 
46  void enableLog(bool is_en);
47  // output to log ile.
48  void log(char* message);
49  void logNoDate(char* message);
50  void puts(char* message, int len);
51  void enablePrintf(bool is_pr);
52  #ifdef LOGFILE_USE_ASYN
53  void setAsynUser(asynUser *pasynUser);
54  #endif
55 
56  protected:
57  enum { num_saved_files = 5 };
58 
59  // file pointer
60  FILE* fp;
61  char log_file_name[255];
62  bool is_enabled;
63  bool is_printf;
64 
65  #ifdef LOGFILE_USE_ASYN
66  // pointer to asyn user, so we can use asynPrint
67  asynUser *pasynUserSelf;
68  #endif
69 
70 };
71 
72 #endif
bool is_printf
Definition: logfile.h:63
FILE * fp
Definition: logfile.h:60
bool is_enabled
Definition: logfile.h:62
Class LOG_FILE.
Definition: logfile.h:38