Comments (5)
Holy smokes. That did it. If you look at src/exampleFour.cpp I was already a bit more careful:
rcppspdlog/src/exampleFour.cpp
Lines 2 to 11 in da99c4a
but that now does it:
edd@rob:~/git/rcppspdlog(feature/with_src)$ git diff src/exampleFour.cpp
diff --git a/src/exampleFour.cpp b/src/exampleFour.cpp
index 99fcff4..f770a0b 100644
--- a/src/exampleFour.cpp
+++ b/src/exampleFour.cpp
@@ -1,4 +1,5 @@
+#define SPDLOG_DISABLE_DEFAULT_LOGGER 1
//#include "spdlog/spdlog.h"
//#include "spdlog/sinks/stdout_color_sinks.h"
#include <spdlog/details/synchronous_factory.h>
edd@rob:~/git/rcppspdlog(feature/with_src)$
from rcppspdlog.
Could this line be the cause of this warning?
from rcppspdlog.
You are very very good. I am not sure how I missed that in my attempts. Now, the stdout
and stderr
checks are independent but we are now down to
* checking compiled code ... NOTE
File ‘RcppSpdlog/libs/RcppSpdlog.so’:
Found ‘stdout’, possibly from ‘stdout’ (C)
Object: ‘exampleFour.o’
Compiled code should not call entry points which might terminate R nor write to stdout/stderr instead
of to the console, nor use Fortran I/O nor system RNGs.
See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual.
* checking examples ... OK
with this simple diff
edd@rob:~/git/rcppspdlog(feature/with_src)$ git diff inst/include/spdlog/logger-inl.h
diff --git a/inst/include/spdlog/logger-inl.h b/inst/include/spdlog/logger-inl.h
index 69d6a1d..da8147a 100644
--- a/inst/include/spdlog/logger-inl.h
+++ b/inst/include/spdlog/logger-inl.h
@@ -12,7 +12,7 @@
#include <spdlog/pattern_formatter.h>
#include <cstdio>
-
+#include <Rcpp.h>
namespace spdlog {
// public methods
@@ -247,7 +247,8 @@ SPDLOG_INLINE void logger::err_handler_(const std::string &msg)
auto tm_time = details::os::localtime(system_clock::to_time_t(now));
char date_buf[64];
std::strftime(date_buf, sizeof(date_buf), "%Y-%m-%d %H:%M:%S", &tm_time);
- fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str());
+ //fprintf(stderr, "[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str());
+ REprintf("[*** LOG ERROR #%04zu ***] [%s] [%s] {%s}\n", err_counter, date_buf, name().c_str(), msg.c_str());
}
}
} // namespace spdlog
edd@rob:~/git/rcppspdlog(feature/with_src)$
(where REprintf()
is R's fprintf(stderr, ...)
, we have Rprintf()
for the normal case).
Now for the remaining stdout
or couple of them. It is really really helpful that your library is so good about 'include what you use' (whereas in Rcpp for example we go with the kitchen sink approach
from rcppspdlog.
Please try to define SPDLOG_DISABLE_DEFAULT_LOGGER before including spdlog.h
This will prevent spdlog the include for ansicolor_sink.h which might cause the last warning
from rcppspdlog.
All good now and merged. Thanks again @gabime !
from rcppspdlog.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcppspdlog.