MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / sGetLogLevel

Method sGetLogLevel

src/App/ApplicationPy.cpp:1136–1162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1134}
1135
1136PyObject* ApplicationPy::sGetLogLevel(PyObject* /*self*/, PyObject* args)
1137{
1138 char* tag {};
1139 if (!PyArg_ParseTuple(args, "s", &tag)) {
1140 return nullptr;
1141 }
1142
1143 PY_TRY
1144 {
1145 int l = -1;
1146 if (strcmp(tag, "Default") == 0) {
1147#ifdef FC_DEBUG
1148 l = static_cast<int>(GetApplication().GetUserParameter().GetGroup("BaseApp/LogLevels")->GetInt(tag, -1));
1149#endif
1150 }
1151 else if (strcmp(tag, "DebugDefault") == 0) {
1152#ifndef FC_DEBUG
1153 l = GetApplication().GetUserParameter().GetGroup("BaseApp/LogLevels")->GetInt(tag, -1);
1154#endif
1155 }
1156 else {
1157 int* pl = Base::Console().getLogLevel(tag, false);
1158 l = pl ? *pl : -1;
1159 }
1160 // For performance reason, we only output integer value
1161 return Py_BuildValue("i", Base::Console().logLevel(l));
1162 }
1163 PY_CATCH;
1164}
1165

Callers

nothing calls this directly

Calls 3

GetIntMethod · 0.80
getLogLevelMethod · 0.80
GetGroupMethod · 0.45

Tested by

no test coverage detected