Skip to content

Commit 65d9f50

Browse files
committed
feat(msgs): add rcl_interfaces logger-level messages and services
Adds the LoggerLevel and SetLoggerLevelsResult messages and the GetLoggerLevels and SetLoggerLevels services under hiroz-codegen assets, and makes hiroz-msgs' build.rs track the codegen asset tree so codegen re-runs when .msg/.srv definitions change. The generated types are not yet consumed by any code — they land ahead of the logging support that uses them.
1 parent d8dcf3d commit 65d9f50

5 files changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# A map of logger name and its logging severity level.
2+
3+
# The logger name '' will set the default logging severity level for a given node.
4+
string name
5+
6+
# The logging severity level.
7+
# Supported logging severity level values from rcl_interfaces/msg/Log:
8+
# DEBUG=10 INFO=20 WARN=30 ERROR=40 FATAL=50
9+
uint32 level
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# A true value indicates the logger level was set successfully.
2+
bool successful
3+
4+
# Reason why the setting was a failure. On success, the contents of this field
5+
# are undefined. This should only be used for logging and user interfaces.
6+
string reason
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# A list of logger names to get the levels for.
2+
string[] names
3+
4+
---
5+
# A list of logger levels, in the same length and order as the provided names.
6+
LoggerLevel[] levels
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# A list of logger levels to set.
2+
LoggerLevel[] levels
3+
4+
---
5+
# A list of results, in the same length and order as the provided levels.
6+
SetLoggerLevelsResult[] results

crates/hiroz-msgs/build.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ use hiroz_codegen::python_msgspec_generator;
77
fn main() -> Result<()> {
88
let out_dir = PathBuf::from(env::var("OUT_DIR")?);
99

10+
// The message/service definitions live outside this crate (in
11+
// hiroz-codegen/assets/), so cargo's default "rerun on package change"
12+
// heuristic never notices when a .msg/.srv is added or edited there. Track
13+
// the asset trees explicitly so codegen re-runs when definitions change.
14+
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
15+
if let Some(codegen_assets) = manifest_dir
16+
.parent()
17+
.map(|p| p.join("hiroz-codegen/assets"))
18+
&& codegen_assets.exists()
19+
{
20+
println!("cargo:rerun-if-changed={}", codegen_assets.display());
21+
}
22+
1023
// Declare custom cfg for ROS version detection
1124
println!("cargo:rustc-check-cfg=cfg(ros_humble)");
1225

0 commit comments

Comments
 (0)