Core Library  1.7.0.0
Library containing core utilities and tools for threading, networking, logging, INI and CSV file management etc.
DebugLogSingleton.h
Go to the documentation of this file.
1 // This file is part of CoreLibrary containing useful reusable utility
2 // classes.
3 //
4 // Copyright (C) 2014 to present, Duncan Crutchley
5 // Contact <dac1976github@outlook.com>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as published
9 // by the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License and GNU Lesser General Public License
16 // for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // and GNU Lesser General Public License along with this program. If
20 // not, see <http://www.gnu.org/licenses/>.
21 
27 #ifndef DEBUGLOGSINGLETON
28 #define DEBUGLOGSINGLETON
29 
30 #include "DebugLog.h"
31 #include <loki/Singleton.h>
32 
34 namespace core_lib
35 {
37 namespace log
38 {
39 
42 
43 using debug_singelton_t =
44  Loki::SingletonHolder<default_log_t, Loki::CreateUsingNew, Loki::DeletableSingleton>;
45 
46 using debug_singelton_deleter_t = Loki::DeletableSingleton<default_log_t>;
47 
48 } // namespace log
49 } // namespace core_lib
50 
51 inline core_lib::log::default_log_t& DebugLogInstance()
52 {
53  return core_lib::log::debug_singelton_t::Instance();
54 }
55 
56 inline void DebugLogGracefulDelete()
57 {
58  core_lib::log::debug_singelton_deleter_t::GracefulDelete();
59 }
60 
62 #define DEBUG_LOG_SINGLETON DebugLogInstance()
63 
65 #define DEBUG_LOG_SINGLETON_DELETER DebugLogGracefulDelete()
66 
67 #endif // DEBUGLOGSINGLETON
File containing declaration of DebugLog class.
The core_lib namespace.
Definition: AsioDefines.h:59
DebugLog class.
Definition: DebugLog.h:276