-
Notifications
You must be signed in to change notification settings - Fork 132
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
base: v3_develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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!
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@@ -57,4 +57,14 @@ void DeviceNode::run() { | |||
// } | |||
} | |||
|
|||
void DeviceNode::setLogLevel(dai::LogLevel level) { | |||
int64_t myid = id; | |||
device->setNodeLogLevel(myid, level); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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 correspondingsetLogLevel
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