FLImaging 7.11.18.11
FLImagingBase/Log.h
1#pragma once
2
10
11#include "FLBase.h"
12
14namespace FLImaging
15{
17 namespace Base
18 {
19 class CInternalLog;
27 typedef void(__stdcall* CLogCallbackProcType)(const wchar_t*, CFLBase*);
28
35 class FL_EXPORT CLog : public CFLBase
36 {
37 protected:
46
47 public:
55 virtual ~CLog();
56
68 static const CResult Initialize();
69
79 static bool IsInitialized();
80
92 static const CResult Terminate();
93
109 static const CResult __stdcall Write(const char* pszFormat, ...);
110
128 static const CResult __stdcall Write(const CFLBase* pFLBase, const char* pszFormat, ...);
129
145 static const CResult __stdcall Write(const wchar_t* pWcsFormat, ...);
146
164 static const CResult __stdcall Write(const CFLBase* pFLBase, const wchar_t* pWcsFormat, ...);
165
183 static const CResult __stdcall WriteWithColor(uint32_t u32Color, const char* pszFormat, ...);
184
204 static const CResult __stdcall WriteWithColor(const CFLBase* pFLBase, uint32_t u32Color, const char* pszFormat, ...);
205
223 static const CResult __stdcall WriteWithColor(uint32_t u32Color, const wchar_t* pWcsFormat, ...);
224
244 static const CResult __stdcall WriteWithColor(const CFLBase* pFLBase, uint32_t u32Color, const wchar_t* pWcsFormat, ...);
245
246
264 static const CResult __stdcall WriteByCategory(const char* pszCategory, const char* pszFormat, ...);
265
285 static const CResult __stdcall WriteByCategory(const CFLBase* pFLBase, const char* pszCategory, const char* pszFormat, ...);
286
304 static const CResult __stdcall WriteByCategory(const wchar_t* pWcsCategory, const wchar_t* pWcsFormat, ...);
305
325 static const CResult __stdcall WriteByCategory(const CFLBase* pFLBase, const wchar_t* pWcsCategory, const wchar_t* pWcsFormat, ...);
326
327
347 static const CResult __stdcall WriteWithColorByCategory(const char* pszCategory, uint32_t u32Color, const char* pszFormat, ...);
348
370 static const CResult __stdcall WriteWithColorByCategory(const CFLBase* pFLBase, const char* pszCategory, uint32_t u32Color, const char* pszFormat, ...);
371
391 static const CResult __stdcall WriteWithColorByCategory(const wchar_t* pWcsCategory, uint32_t u32Color, const wchar_t* pWcsFormat, ...);
392
414 static const CResult __stdcall WriteWithColorByCategory(const CFLBase* pFLBase, const wchar_t* pWcsCategory, uint32_t u32Color, const wchar_t* pWcsFormat, ...);
415
416
428 static const CResult SetLogBufferSize(int64_t i64BufferSize = 65536);
429
430
440 static int64_t GetLogBufferSize();
441
442
452 static void SetLogPath(const wchar_t* pWcsLogPath = nullptr);
453
454
464 static const wchar_t* GetLogPathName();
465
475 static const wchar_t* GetLogFileName();
476
486 static const wchar_t* GetLogFileNameWithPath();
487
503 static void SetLogCallback(CLogCallbackProcType pCallback, CFLBase* pReceiver);
504
515
528
529 DeclareGetClassType();
530
531 private:
532 static CLog* GetInstance();
533
534 CInternalLog* m_pInternal;
535 };
536 }
537}
538
Top-level base class of FLImaging.
Definition FLImagingBase/FLBase.h:36
CFLBase()
Default constructor.
static const wchar_t * GetLogFileName()
Get log save file name.
static CFLBase * GetReceiver()
Return log callback receive object pointer.
static const CResult __stdcall Write(const CFLBase *pFLBase, const char *pszFormat,...)
Writes a log entry.
static const CResult __stdcall WriteWithColor(uint32_t u32Color, const wchar_t *pWcsFormat,...)
Write log with specified color.
static const CResult __stdcall WriteWithColorByCategory(const CFLBase *pFLBase, const char *pszCategory, uint32_t u32Color, const char *pszFormat,...)
Write log with specified color and category.
static const CResult __stdcall WriteByCategory(const CFLBase *pFLBase, const char *pszCategory, const char *pszFormat,...)
Write log by specified categories.
virtual ~CLog()
Destructor.
static bool IsInitialized()
Get initialization status.
static const CResult __stdcall WriteWithColorByCategory(const CFLBase *pFLBase, const wchar_t *pWcsCategory, uint32_t u32Color, const wchar_t *pWcsFormat,...)
Write log with specified color and category.
static const wchar_t * GetLogFileNameWithPath()
Get log save file name including path.
static const CResult __stdcall Write(const wchar_t *pWcsFormat,...)
Write log.
static const CResult __stdcall WriteWithColor(uint32_t u32Color, const char *pszFormat,...)
Write log with specified color.
static const CResult __stdcall Write(const char *pszFormat,...)
Write log.
static const CResult __stdcall Write(const CFLBase *pFLBase, const wchar_t *pWcsFormat,...)
Writes a log entry.
static int64_t GetLogBufferSize()
Get size of buffer to create when writing a log.
static const CResult Initialize()
Initialize.
static const CResult __stdcall WriteWithColor(const CFLBase *pFLBase, uint32_t u32Color, const char *pszFormat,...)
Write log with specified color.
static CLogCallbackProcType GetLogCallback()
Get log callback.
CLog()
Constructor.
static const CResult __stdcall WriteByCategory(const wchar_t *pWcsCategory, const wchar_t *pWcsFormat,...)
Write log by specified categories.
static const CResult __stdcall WriteWithColorByCategory(const char *pszCategory, uint32_t u32Color, const char *pszFormat,...)
Write log with specified color and category.
static const CResult Terminate()
Terminate the log system. After explicitly calling the function, the log recording function will no l...
static const wchar_t * GetLogPathName()
Get log save path.
static void SetLogCallback(CLogCallbackProcType pCallback, CFLBase *pReceiver)
Set log callback.
static const CResult __stdcall WriteByCategory(const CFLBase *pFLBase, const wchar_t *pWcsCategory, const wchar_t *pWcsFormat,...)
Write log by specified categories.
static void SetLogPath(const wchar_t *pWcsLogPath=nullptr)
Specify log storage path.
static const CResult __stdcall WriteWithColor(const CFLBase *pFLBase, uint32_t u32Color, const wchar_t *pWcsFormat,...)
Write log with specified color.
static const CResult SetLogBufferSize(int64_t i64BufferSize=65536)
Set the size of the buffer to create when writing a log.
static const CResult __stdcall WriteWithColorByCategory(const wchar_t *pWcsCategory, uint32_t u32Color, const wchar_t *pWcsFormat,...)
Write log with specified color and category.
static const CResult __stdcall WriteByCategory(const char *pszCategory, const char *pszFormat,...)
Write log by specified categories.
FLImaging module execution result object.
Definition FLImagingBase/ResultsDef.h:1739
Definition FLImagingBase/AESCryptography.h:18
void(__stdcall * CLogCallbackProcType)(const wchar_t *, CFLBase *)
Log Callback Procedure Type.
Definition FLImagingBase/Log.h:27