Add logs to libsimpleservo C API

This commit is contained in:
Paul Rouget 2019-02-06 04:21:32 +01:00
parent 399456665c
commit 1292db6824
3 changed files with 5 additions and 0 deletions

View file

@ -15,6 +15,7 @@ bench = false
[dependencies]
simpleservo = { path = "../api" }
log = "0.4"
env_logger = "0.6"
[features]
default = ["unstable", "default-except-unstable"]

View file

@ -5,6 +5,7 @@
#[macro_use]
extern crate log;
use env_logger;
use simpleservo::{self, gl_glue, EventLoopWaker, HostTrait, InitOptions, ServoGlue, SERVO};
use std::ffi::{CStr, CString};
use std::mem;
@ -68,6 +69,8 @@ fn init(
wakeup: extern "C" fn(),
callbacks: CHostCallbacks,
) {
crate::env_logger::init();
let args = unsafe { CStr::from_ptr(opts.args) };
let args = args.to_str().map(|s| s.to_string()).ok();