Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/per node log level setting #1217

Open
wants to merge 12 commits into
base: v3_develop
Choose a base branch
from

Conversation

lnotspotl
Copy link
Member

@lnotspotl lnotspotl commented Jan 21, 2025

This PR adds the functionality of log-level setting for individual nodes. The functionality added allows us to set log-levels for individual nodes, both before and after starting the pipeline (pipeline.start()) call.

Note that if one sets the DEPTHAI_LEVEL environment variable, it will get overridden by the corresponding setLogLevel method call for a node. Moreover, if one sets the log level for the entire device (device.setLogLevel(...)), the per-node log levels get overridden.

Thus we have the following hierarchy, where greater means precedence.

DEPTHAI_LEVEL < Node < Device

As part of this PR, I have also refactored the test for log-level testing, trying to avoid copy-pasted code.

Clickup task: https://app.clickup.com/t/86c1gb36k

@lnotspotl lnotspotl self-assigned this Jan 21, 2025
Copy link
Collaborator

@moratom moratom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Left a few clarifying questions, but looks good to me!

examples/python/Benchmark/benchmark_simple.py Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant to the PR I think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how these changes got into the PR. Removed a2cfcf8

include/depthai/pipeline/NodeObjInfo.hpp Show resolved Hide resolved
@@ -57,4 +57,14 @@ void DeviceNode::run() {
// }
}

void DeviceNode::setLogLevel(dai::LogLevel level) {
int64_t myid = id;
device->setNodeLogLevel(myid, level);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even before pipeline.start()? Intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, setting the log level before starting the pipeline is a feature, not something unintended.

src/pipeline/DeviceNodeGroup.cpp Outdated Show resolved Hide resolved
src/pipeline/Pipeline.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants