MeshLib Documentation
Loading...
Searching...
No Matches
MRLog.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRPch/MRSpdlog.h"
5#include "MRPch/MRBindingMacros.h"
6#include <filesystem>
7
8namespace MR
9{
10
13
15class MR_BIND_IGNORE Logger
16{
17public:
19
21 MRMESH_API const std::shared_ptr<spdlog::logger>& getSpdLogger() const;
22
24 MRMESH_API std::string getDefaultPattern() const;
25
27 MRMESH_API void addSink( const spdlog::sink_ptr& sink );
28 MRMESH_API void removeSink( const spdlog::sink_ptr& sink );
29
31 MRMESH_API std::filesystem::path getLogFileName() const;
32private:
33 Logger();
34 std::shared_ptr<spdlog::logger> logger_;
35};
36
38
39}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Make default spd logger.
Definition MRLog.h:16
MRMESH_API void addSink(const spdlog::sink_ptr &sink)
adds custom sink to logger
MRMESH_API std::filesystem::path getLogFileName() const
return filename of first found file sink, if there is no one, returns {}
MRMESH_API void removeSink(const spdlog::sink_ptr &sink)
static MRMESH_API Logger & instance()
MRMESH_API const std::shared_ptr< spdlog::logger > & getSpdLogger() const
store this pointer if need to prolong logger life time (necessary to log something from destructors)
MRMESH_API std::string getDefaultPattern() const
returns default logger pattern
Definition MRCameraOrientationPlugin.h:8