Skip to content

logging #173

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

Open
abdelaziz-mahdy opened this issue Jul 24, 2024 · 5 comments
Open

logging #173

abdelaziz-mahdy opened this issue Jul 24, 2024 · 5 comments
Labels
question Further information is requested

Comments

@abdelaziz-mahdy
Copy link
Contributor

how to enable logging for opencv i found this https://stackoverflow.com/questions/54828885/how-to-enable-logging-for-opencv but i didnt find any method to set log level in the dart interface.

@abdelaziz-mahdy abdelaziz-mahdy added the question Further information is requested label Jul 24, 2024
@rainyl
Copy link
Owner

rainyl commented Jul 24, 2024

https://stackoverflow.com/a/67417220/18539998

This answer says opencv uses environment variable to set log level, I tested it on windows and it does work.

And the logs are written to stdout, maybe a redirection is needed if you want to capture them.

import 'package:opencv_dart/opencv_dart.dart' as cv;

void main(List<String> args) {
  final data3D = [
    [
      [1, 2, 3],
      [4, 5, 6],
      [7, 8, 9],
    ],
    [
      [10, 11, 12],
      [13, 14, 15],
      [16, 17, 18],
    ],
    [
      [19, 20, 21],
      [22, 23, 24],
      [25, 26, 27],
    ],
  ];
  final matFrom3DList = cv.Mat.from3DList(data3D, cv.MatType.CV_8UC3);

  print(matFrom3DList);

  final model = cv.Net.fromOnnx("test/models/googlenet-9.onnx");
}

image
image

@abdelaziz-mahdy
Copy link
Contributor Author

yeah we need to check for a way to capture the logs across all platforms , since people may need to capture logs from user devices to debug problems

a redirect to dart will be the best option, and then people can handle it the way they see fit or ignore it

@rainyl
Copy link
Owner

rainyl commented Jul 24, 2024

Setting log level is easy to implement, but I have no idea about how to capture the stdout from native/ffi, do you have any ideas?

@abdelaziz-mahdy
Copy link
Contributor Author

Setting log level is easy to implement, but I have no idea about how to capture the stdout from native/ffi, do you have any ideas?

i dont know how too, and searched how to redirect opencv logs but couldnt find any resource, will need to look into it, for now setting logging level is a good start, then we can check how to redirect later dont you agree?

want me to start working on it?

@rainyl
Copy link
Owner

rainyl commented Jul 25, 2024

Setting log level is easy to implement, but I have no idea about how to capture the stdout from native/ffi, do you have any ideas?

i dont know how too, and searched how to redirect opencv logs but couldnt find any resource, will need to look into it, for now setting logging level is a good start, then we can check how to redirect later dont you agree?

Agree.

want me to start working on it?

Just do it if you want. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants