mapnik / mapnik

Mapnik is an open source toolkit for developing mapping applications

Home Page:http://mapnik.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"unable to find face-name in fontset" log warnings are actually errors

hholzgra opened this issue · comments

I originally logged this as mapnik/python-mapnik#226, but it turned out to actually be a general problem, and not Python binding specific. So re-filing it here.

Failure to find a specific font for a fontset face name logs warnings like

warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-4'

Given that the messages print warning: ... I tried to filter them out by setting the logger severity_level to Error, but I was still getting them. Only when setting the severity level to None the font warnings were gone, but with that actual errors would not be logged at all either.

Turns out while the log message reads warning: ... it is actually logged using MAPNIK_LOG_ERROR:

  // https://github.com/mapnik/mapnik/issues/1791
  MAPNIK_LOG_ERROR(fontset) << "warning: unable to find face-name '"
                            << n.get_attr<std::string>("face-name","")
                            << "' in FontSet '" << fontset.get_name() << "'";

I'm getting these warnings on my render server a lot as many of the OpenStreetMap styles list a large number of alternative fonts per font set, some of them only available on specific operating systems, to make the styles work on multiple platforms.

So render logs get spammed by these unable to find face-name messages a lot, and I'd really like to be able to get rid of them without having to filter the log output after the fact.

So does this really need to be logged with MAPNIK_LOG_ERROR?

Or would it actually be ok to change it to MAPNIK_LOG_WARN, and to only raise an actual error when none of the face names in a font set can be found?

@hholzgra - looks like oversight, thanks for reporting.

@hholzgra closing as fixed