Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLAScommon
Commits
d818bcab
Commit
d818bcab
authored
Jul 07, 2021
by
Steffen Vogel
🎅🏼
Browse files
plugin: add support for spdlog custom formatter
parent
574f4467
Changes
1
Show whitespace changes
Inline
Side-by-side
include/villas/plugin.hpp
View file @
d818bcab
...
...
@@ -28,6 +28,7 @@
#include <list>
#include <string>
#include <jansson.h>
#include <spdlog/fmt/ostr.h>
#include <villas/log.hpp>
#include <villas/common.hpp>
...
...
@@ -139,6 +140,13 @@ public:
virtual
std
::
string
getDescription
()
const
=
0
;
/** Custom formatter for spdlog */
template
<
typename
OStream
>
friend
OStream
&
operator
<<
(
OStream
&
os
,
const
class
Plugin
&
p
)
{
return
os
<<
p
.
getName
();
}
protected:
std
::
string
path
;
...
...
@@ -160,7 +168,7 @@ Registry::dumpList()
for
(
Plugin
*
p
:
*
plugins
)
{
T
*
t
=
dynamic_cast
<
T
*>
(
p
);
if
(
t
)
getLogger
()
->
info
(
" - {}: {}"
,
p
->
getName
()
,
p
->
getDescription
());
getLogger
()
->
info
(
" - {}: {}"
,
*
p
,
p
->
getDescription
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment