Mentions légales du service

Skip to content

dtkLogger: Do not attach the console more than once

If the console is already attached, do not attach it again.

For information (and for @clebreto), it happens in the CGAL polyhedron demo (in the nurbs-viewer branch) where every created item (nurbs, bezier patches) calls:

dtkLogger::instance().attachConsole();

and as a result all the dtkDebug lines were displayed dozens of time on the console.

One issue is that there is no way to check if a dtkLogDestination is already attached or not. That is why the solution I found is to avoid attaching the console several times. Maybe that sort of checking could be done as well before attaching a file, or a model.

Merge request reports