Skip to content
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

Be able to configure Mapnik's logger severity level through options #25

Open
dgaubert opened this issue May 1, 2020 · 3 comments
Open

Comments

@dgaubert
Copy link
Contributor

dgaubert commented May 1, 2020

Mapnik uses stdout for logging and we might want to decide what to do with them.

$ node
> const mapnik = require('@carto/mapnik');
undefined
> mapnik.Logger
{ [Function: Logger]
  getSeverity: [Function: getSeverity],
  setSeverity: [Function: setSeverity],
  NONE: 3,
  ERROR: 2,
  DEBUG: 0,
  WARN: 1 }
> mapnik.Logger.getSeverity()
2
> mapnik.Logger.setSeverity(mapnik.Logger.NONE)
undefined
> mapnik.Logger.getSeverity()
3

@Algunenano, do you know what severity level we are setting for the logger while compiling @carto/mapnik?

@dgaubert
Copy link
Contributor Author

dgaubert commented May 1, 2020

We redirect stdout to a file and it's polluted with messages as follows:

WARNING:  ST_Line_Interpolate_Point signature was deprecated in 2.1.0. Please use ST_LineInterpolatePoint
WARNING:  ST_Line_Interpolate_Point signature was deprecated in 2.1.0. Please use ST_LineInterpolatePoint
WARNING:  ST_Line_Interpolate_Point signature was deprecated in 2.1.0. Please use ST_LineInterpolatePoint
WARNING:  ST_Line_Interpolate_Point signature was deprecated in 2.1.0. Please use ST_LineInterpolatePoint
WARNING:  ST_Line_Interpolate_Point signature was deprecated in 2.1.0. Please use ST_LineInterpolatePoint
WARNING:  ST_Line_Interpolate_Point signature was deprecated in 2.1.0. Please use ST_LineInterpolatePoint
WARNING:  ST_Line_Interpolate_Point signature was deprecated in 2.1.0. Please use ST_LineInterpolatePoint
WARNING:  ST_Line_Interpolate_Point signature was deprecated in 2.1.0. Please use ST_LineInterpolatePoint
Mapnik LOG> 2020-05-01 12:20:17: SVG PARSING ERROR:"SVG support error: <font-size> attribute is not supported"
Mapnik LOG> 2020-05-01 12:20:17: SVG PARSING ERROR:"SVG support error: <font-style> attribute is not supported"
Mapnik LOG> 2020-05-01 12:20:17: SVG PARSING ERROR:"SVG support error: <font-variant> attribute is not supported"
Mapnik LOG> 2020-05-01 12:20:17: SVG PARSING ERROR:"SVG support error: <font-weight> attribute is not supported
NOTICE:  identifier "right_temps_perdu_moyen_par_jour_supplementaire_en_heure_de_pointe" will be truncated to "right_temps_perdu_moyen_par_jour_supplementaire_en_heure_de_poi"
NOTICE:  identifier "right_temps_perdu_moyen_par_jour_supplementaire_en_heure_de_pointe" will be truncated to "right_temps_perdu_moyen_par_jour_supplementaire_en_heure_de_poi"
NOTICE:  identifier "right_do_any_hospitals_have_access_to_a_tax_refund_offset_program_in" will be truncated to "right_do_any_hospitals_have_access_to_a_tax_refund_offset_progr"
NOTICE:  identifier "right_do_any_hospitals_have_access_to_a_tax_refund_offset_program_in" will be truncated to "right_do_any_hospitals_have_access_to_a_tax_refund_offset_progr"
WARNING:  ST_Shift_Longitude signature was deprecated in 2.2.0. Please use ST_ShiftLongitude
WARNING:  ST_Shift_Longitude signature was deprecated in 2.2.0. Please use ST_ShiftLongitude

We've never done anything with them, wondering how useful are they and what approach we should give to them.

@dgaubert
Copy link
Contributor Author

dgaubert commented May 1, 2020

Also wondering why some of them have the prefix Mapnik LOG> {TIMESTAMP} and if they can be omitted by setting a higher security level.

@Algunenano
Copy link
Contributor

@Algunenano, do you know what severity level we are setting for the logger while compiling @carto/mapnik?

We don't change it https://github.com/CartoDB/mason/blob/master/scripts/mapnik/3.0.15-carto/script.sh so whatever is default.

The log level is defined at compile time, and when it's not defined it's automatically set to 2 (https://github.com/CartoDB/mapnik/blob/1021a5e3059e939ffc78b84792e605ae6fd8344c/src/debug.cpp#L41) which enables logger::error.

The SVG PARSING ERROR messages are reported by the svg_parser.

The logs starting from WARNING or NOTICE come from the database and don't have the mapnik log format (they should start with Mapnik LOG>), so they are either printed without the logs (I couldn't find them) or they are printed directly by libpq for some reason. I would need to investigate further to find where they are being emited.

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

No branches or pull requests

2 participants