ffi: fix build error

This commit is contained in:
eric committed 2021-04-05 18:53:44 +08:00
1 parent ea3454f0b2
commit 0132b5ced1
2 files changed
+8 -4

No files matched your search

+2 -4
View File
@@ -30,10 +30,8 @@ fn run(rt: &tokio::runtime::Runtime, config: leaf::config::Config) {
config::Log_Output::CONSOLE => {
#[cfg(any(target_os = "ios", target_os = "android"))]
{
let console_output = fern::Output::writer(
Box::new(logger::ConsoleWriter(BytesMut::new())),
"\n",
);
let console_output =
fern::Output::writer(Box::new(logger::ConsoleWriter::default()), "\n");
logger = logger.chain(console_output);
}
#[cfg(not(any(target_os = "ios", target_os = "android")))]
+6
View File
@@ -45,6 +45,12 @@ fn log_out(data: &[u8]) {
pub struct ConsoleWriter(pub BytesMut);
impl Default for ConsoleWriter {
fn default() -> Self {
ConsoleWriter(BytesMut::new())
}
}
unsafe impl Send for ConsoleWriter {}
impl Write for ConsoleWriter {