openframeworks/openFrameworks — Issue #1033: ofSetLogLevel(module, level) adds to map but dosen't remove
Author: danomatika
Created: 2012-03-04 10:54:12+00:00
State: open

I talked to Arturo about this, but I want to make sure it's known. When you call ofLogSetLogLevel with a module string, that string is added to a map used to check the module's log level ... but right now that string is never removed.

If someone creates a large amount module names the map could grow arbitrarily large over time. The thought so far is that no one would make enough module names for it to be a problem.

For instance, using the proposed ofThread rewrite, each thread creates a new module name when it sets itself to verbose and, in the case of spawning lots of verbose worker threads, the map will grow.

My proposed solution would be to remove the module name from the map when the level for that module is set back to OF_LOG_NOTICE and/or to the current log level.