Scope
ScopeLogger.cpp
1 #include "stdafx.h"
2 #include "ScopeLogger.h"
3 #include "ScopeLogger_p.h"
4 #include "gui/LogFrame.h"
5 #include "parameters/Windows.h"
6 
7 namespace scope {
8 
9 ScopeLogger::Impl& ScopeLogger::GetImpl(const log_message_type& filem, const log_message_type& consolem, const log_message_type& logboxm) {
10  static Impl sImpl(filem, consolem, logboxm);
11  return sImpl;
12 }
13 
15  return pimpl;
16 }
17 
18 ScopeLogger::ScopeLogger(const log_message_type& filem, const log_message_type& consolem, const log_message_type& logboxm)
19  : pimpl(&GetImpl(filem, consolem, logboxm)) {
20 }
21 
22 void ScopeLogger::SetFilepath(const std::wstring& _filepath) {
23  Pimpl()->SetFilepath(_filepath);
24 }
25 
26 void ScopeLogger::Log(const std::wstring& message, const log_message_type& msgtype) {
27  Pimpl()->Log(message, msgtype);
28 }
29 
31  Pimpl()->AttachLogFrame(_logframe);
32 }
33 
35  return Pimpl()->GetLogFrameWindow();
36 }
37 
39  return Pimpl()->HasLogFrame();
40 }
41 
44 }
45 
47  Pimpl()->DetachLogFrame();
48 }
49 
51  Pimpl()->Shutdown();
52 }
53 
54 }
void GetUserLoggings()
Gets the text in the logbook window and calls FlushLogbox.
void GetUserLoggings()
Gets the text in the logbook window and calls FlushLogbox.
Definition: ScopeLogger.cpp:42
void DetachLogFrame()
Detaches a CLogFrame.
Definition: ScopeLogger.cpp:46
Impl & GetImpl(const log_message_type &filem, const log_message_type &consolem, const log_message_type &logboxm)
Has the local static implementation object static local variable is in there.
Definition: ScopeLogger.cpp:9
void SetFilepath(const std::wstring &_filepath=L"C:\\ScopeData")
Sets the filepath and creates logfile.
Implementation class of the ScopeLogger.
Definition: ScopeLogger_p.h:12
void SetFilepath(const std::wstring &_filepath=L"C:\\ScopeData")
Sets the filepath and creates logfile.
Definition: ScopeLogger.cpp:22
This is the include file for standard system include files, or project specific include files that ar...
void Log(const std::wstring &message, const log_message_type &msgtype)
Logs a message.
Definition: ScopeLogger.cpp:26
void Shutdown()
Calls ScopeLogger::Impl::Shutdown.
Definition: ScopeLogger.cpp:50
Frame window class for the log.
Definition: LogFrame.h:10
void AttachLogFrame(gui::CLogFrame *const _logframe)
Attaches a CLogFrame as the logbook window.
Impl *const Pimpl()
Definition: ScopeLogger.cpp:14
void AttachLogFrame(gui::CLogFrame *const _logframe)
Attaches a CLogFrame as the logbook window.
Definition: ScopeLogger.cpp:30
ScopeLogger(const log_message_type &_filem=log_all, const log_message_type &_consolem=log_all, const log_message_type &_logboxm=log_all)
Sets the pimpl from GetImpl.
Definition: ScopeLogger.cpp:18
Impl *const pimpl
pointer to the implementation
Definition: ScopeLogger.h:28
void DetachLogFrame()
Detaches a CLogFrame.
void Shutdown()
Shutdown the Active, called from Run in scope.cpp.
void Log(const std::wstring &message, const log_message_type &msgtype)
Logs a message.
HWND GetLogFrameWindow()
Saves log frame parameters into Window (for recreating windows on startup).
Definition: ScopeLogger.cpp:34
HWND GetLogFrameWindow()
Saves log frame parameters into Window (for recreating windows on startup)