mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add logs to libsimpleservo C API
This commit is contained in:
parent
399456665c
commit
1292db6824
3 changed files with 5 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -3949,6 +3949,7 @@ dependencies = [
|
|||
name = "simpleservo_capi"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"simpleservo 0.0.1",
|
||||
]
|
||||
|
|
|
@ -15,6 +15,7 @@ bench = false
|
|||
[dependencies]
|
||||
simpleservo = { path = "../api" }
|
||||
log = "0.4"
|
||||
env_logger = "0.6"
|
||||
|
||||
[features]
|
||||
default = ["unstable", "default-except-unstable"]
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue