Wasatch.VCPP 1.0.19
Visual C++ driver for Wasatch Photonics spectrometers
Logger.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <fstream>
11#include <string>
12#include <vector>
13
14namespace WasatchVCPP
15{
17 class Logger
18 {
19 public:
21 enum class Levels
22 {
23 LOG_LEVEL_DEBUG = 0,
24 LOG_LEVEL_INFO = 1,
25 LOG_LEVEL_ERROR = 2,
26 LOG_LEVEL_NEVER = 3
27 };
28
29 Levels level = Levels::LOG_LEVEL_DEBUG;
30
31 void debug(const char* fmt, ...);
32 void info(const char* fmt, ...);
33 void error(const char* fmt, ...);
34
35 bool setLogfile(const std::string& pathname);
36
37 private:
38 void output(const std::string& lvlName, const std::string& msg);
39 std::ofstream logfile;
40 };
41}
42
Internal logger (outputs to textfile if configured).
Definition: Logger.h:18
Levels
keep synchronized with like-named macros in WasatchVCPP.h
Definition: Logger.h:22
Namespace encapsulating the internal implementation of WasatchVCPP; customers would not normally acce...
Definition: Driver.h:26