mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +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"
|
name = "simpleservo_capi"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
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)",
|
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"simpleservo 0.0.1",
|
"simpleservo 0.0.1",
|
||||||
]
|
]
|
||||||
|
|
|
@ -15,6 +15,7 @@ bench = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
simpleservo = { path = "../api" }
|
simpleservo = { path = "../api" }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
env_logger = "0.6"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["unstable", "default-except-unstable"]
|
default = ["unstable", "default-except-unstable"]
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
|
use env_logger;
|
||||||
use simpleservo::{self, gl_glue, EventLoopWaker, HostTrait, InitOptions, ServoGlue, SERVO};
|
use simpleservo::{self, gl_glue, EventLoopWaker, HostTrait, InitOptions, ServoGlue, SERVO};
|
||||||
use std::ffi::{CStr, CString};
|
use std::ffi::{CStr, CString};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
@ -68,6 +69,8 @@ fn init(
|
||||||
wakeup: extern "C" fn(),
|
wakeup: extern "C" fn(),
|
||||||
callbacks: CHostCallbacks,
|
callbacks: CHostCallbacks,
|
||||||
) {
|
) {
|
||||||
|
crate::env_logger::init();
|
||||||
|
|
||||||
let args = unsafe { CStr::from_ptr(opts.args) };
|
let args = unsafe { CStr::from_ptr(opts.args) };
|
||||||
let args = args.to_str().map(|s| s.to_string()).ok();
|
let args = args.to_str().map(|s| s.to_string()).ok();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue