Skip to content

Commit

Permalink
Add logs to libsimpleservo C API
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrouget committed Feb 7, 2019
1 parent 3994566 commit 1292db6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ports/libsimpleservo/capi/Cargo.toml
Expand Up @@ -15,6 +15,7 @@ bench = false
[dependencies]
simpleservo = { path = "../api" }
log = "0.4"
env_logger = "0.6"

[features]
default = ["unstable", "default-except-unstable"]
Expand Down
3 changes: 3 additions & 0 deletions ports/libsimpleservo/capi/src/lib.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 1292db6

Please sign in to comment.