VERB_code_2.2  2
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Output.h
Go to the documentation of this file.
1 /**
2  * \file Output.h
3  * \brief Logging and screen output. see namespace Output for details
4  *
5  * The file provide output functions. Output usually goes to a screen and a file
6  * simultaniously.
7  *
8  * \todo
9  * - Find out what is the maximum level of the message
10  *
11  * \author Developed under supervision of the PI Yuri Shprits
12  */
13 
14 #ifndef OUTPUT_H
15 
16 /// \def OUTPUT_H
17 /// \brief Check if OUTPUT_H is defined, to not include the class more then one time.
18 #define OUTPUT_H
19 
20 #include <string.h>
21 #include <stdarg.h>
22 #include <sstream>
23 #include <fstream>
24 #include <iostream>
25 
26 // deprecated ??? (it was defined in main.cpp)
27 #include <ctime>
28 #include <time.h>
29 
30 // include functions, provided exceptions handling
31 #include "../Exceptions/error.h"
32 
33 /**
34 * \namespace Output
35 * \brief functions for write log and support files. Functions are defined in Output.h and descripted in Output.cpp
36 */
37 namespace Output {
38 
39 
40  /** \brief Open file stream for log file
41  * \param filename - name of log file */
42  void open_log_file(string filename);
43 
44  /** \brief Close file stream for log file */
45  void close_log_file();
46 
47  /** \brief flush file stream for log file */
48  void flush_log_file();
49 
50  /** \brief Basic function! Write the message to the file
51  * \param msglvl - verbose level for the message from 0 to 3
52  * \param format - sprintf format for the output string
53  * \param ... - variables used for format string */
54  void echo(int msglvl, const char * format, ... );
55 
56  /** \brief Set the verbose level until redefine
57  * \param new_outputLvl - verbose level */
58  void set_output_lvl(int new_outputLvl);
59 
60 }
61 
62 #endif