Skip to content

Commit

Permalink
[eclipse-iceoryx#210] Set log level to 'Info' for dummy lang C functions
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jun 1, 2024
1 parent 4dbd0db commit cbf0878
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions iceoryx2-lang/c/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ cbindgen = { workspace = true }

[dependencies]
iceoryx2 = { workspace = true }
iceoryx2-bb-log = { workspace = true }
3 changes: 3 additions & 0 deletions iceoryx2-lang/c/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use iceoryx2::prelude::*;
use iceoryx2_bb_log::set_log_level;

mod publisher;
mod subscriber;
Expand All @@ -8,6 +9,8 @@ pub use subscriber::*;

#[no_mangle]
pub extern "C" fn zero_copy_service_list() -> i32 {
set_log_level(iceoryx2_bb_log::LogLevel::Info);

let services = zero_copy::Service::list();

if services.is_err() {
Expand Down
3 changes: 3 additions & 0 deletions iceoryx2-lang/c/src/publisher.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
use core::time::Duration;
use iceoryx2::prelude::*;
use iceoryx2_bb_log::set_log_level;

const CYCLE_TIME: Duration = Duration::from_secs(1);

#[no_mangle]
pub extern "C" fn run_publisher(seconds: u32) -> i32 {
set_log_level(iceoryx2_bb_log::LogLevel::Info);

let service_name = ServiceName::new("Hello/from/C");

if service_name.is_err() {
Expand Down
3 changes: 3 additions & 0 deletions iceoryx2-lang/c/src/subscriber.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
use core::time::Duration;
use iceoryx2::prelude::*;
use iceoryx2_bb_log::set_log_level;

const CYCLE_TIME: Duration = Duration::from_secs(1);

#[no_mangle]
pub extern "C" fn run_subscriber(seconds: u32) -> i32 {
set_log_level(iceoryx2_bb_log::LogLevel::Info);

let service_name = ServiceName::new("Hello/from/C");

if service_name.is_err() {
Expand Down

0 comments on commit cbf0878

Please sign in to comment.