| 1134 | } |
| 1135 | |
| 1136 | PyObject* 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 |
nothing calls this directly
no test coverage detected