MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPLIsDebugEnabled

Function CPLIsDebugEnabled

port/cpl_conv.cpp:1962–1984  ·  view source on GitHub ↗

Returns whether CPL_DEBUG is enabled. * * @since 3.11 */

Source from the content-addressed store, hash-verified

1960 * @since 3.11
1961 */
1962bool CPLIsDebugEnabled()
1963{
1964 if (gnDebug < 0)
1965 {
1966 // Check that apszKnownConfigOptions is correctly sorted with
1967 // STRCASECMP() criterion.
1968 for (size_t i = 1; i < CPL_ARRAYSIZE(apszKnownConfigOptions); ++i)
1969 {
1970 if (STRCASECMP(apszKnownConfigOptions[i - 1],
1971 apszKnownConfigOptions[i]) >= 0)
1972 {
1973 CPLError(CE_Failure, CPLE_AppDefined,
1974 "ERROR: apszKnownConfigOptions[] isn't correctly "
1975 "sorted: %s >= %s",
1976 apszKnownConfigOptions[i - 1],
1977 apszKnownConfigOptions[i]);
1978 }
1979 }
1980 gnDebug = CPLTestBool(CPLGetConfigOption("CPL_DEBUG", "OFF"));
1981 }
1982
1983 return gnDebug != 0;
1984}
1985
1986/************************************************************************/
1987/* CPLDeclareKnownConfigOption() */

Callers 4

DumpMethod · 0.85
CPLHTTPSetOptionsFunction · 0.85

Calls 2

CPLErrorFunction · 0.85
CPLTestBoolFunction · 0.85

Tested by

no test coverage detected