ofSetLogLevel(module, level) adds to map but dosen't remove

Open
#1,033 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
observability

Research direction

Start by locating the implementation of ofLogSetLogLevel and the map used for module log levels. Reproduce repeated module-level changes, then verify that resetting a module to OF_LOG_NOTICE or the current log level no longer leaves its name retained in the map.

Written by the indexing model from the issue text.

Description

core feature

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.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openframeworks/openFrameworks

All issues in openframeworks/openFrameworks

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.