| Directory: | ./ |
|---|---|
| File: | bindings/python/parsers/urdf/console-bridge.cpp |
| Date: | 2025-02-12 21:03:38 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 10 | 10 | 100.0% |
| Branches: | 6 | 12 | 50.0% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2020 INRIA | ||
| 3 | // | ||
| 4 | |||
| 5 | #include <boost/python.hpp> | ||
| 6 | #include "pinocchio/bindings/python/parsers/urdf.hpp" | ||
| 7 | #include "pinocchio/bindings/python/utils/registration.hpp" | ||
| 8 | |||
| 9 | #ifdef PINOCCHIO_WITH_URDFDOM | ||
| 10 | #include <console_bridge/console.h> | ||
| 11 | #endif | ||
| 12 | |||
| 13 | namespace pinocchio | ||
| 14 | { | ||
| 15 | namespace python | ||
| 16 | { | ||
| 17 | 65 | void exposeConsoleBridge() | |
| 18 | { | ||
| 19 | namespace bp = boost::python; | ||
| 20 | |||
| 21 | #ifdef PINOCCHIO_WITH_URDFDOM | ||
| 22 | |||
| 23 | // fix CONSOLE_BRIDGE warning level | ||
| 24 | 65 | ::console_bridge::setLogLevel(::console_bridge::CONSOLE_BRIDGE_LOG_ERROR); | |
| 25 | |||
| 26 | typedef ::console_bridge::LogLevel LogLevel; | ||
| 27 |
1/2✓ Branch 1 taken 65 times.
✗ Branch 2 not taken.
|
65 | if (!register_symbolic_link_to_registered_type<LogLevel>()) |
| 28 | { | ||
| 29 | 130 | bp::enum_<LogLevel>("LogLevel") | |
| 30 |
1/2✓ Branch 1 taken 65 times.
✗ Branch 2 not taken.
|
65 | .value("CONSOLE_BRIDGE_LOG_DEBUG", ::console_bridge::CONSOLE_BRIDGE_LOG_DEBUG) |
| 31 |
1/2✓ Branch 1 taken 65 times.
✗ Branch 2 not taken.
|
65 | .value("CONSOLE_BRIDGE_LOG_INFO", ::console_bridge::CONSOLE_BRIDGE_LOG_INFO) |
| 32 |
1/2✓ Branch 1 taken 65 times.
✗ Branch 2 not taken.
|
65 | .value("CONSOLE_BRIDGE_LOG_WARN", ::console_bridge::CONSOLE_BRIDGE_LOG_WARN) |
| 33 |
1/2✓ Branch 1 taken 65 times.
✗ Branch 2 not taken.
|
65 | .value("CONSOLE_BRIDGE_LOG_ERROR", ::console_bridge::CONSOLE_BRIDGE_LOG_ERROR) |
| 34 |
1/2✓ Branch 1 taken 65 times.
✗ Branch 2 not taken.
|
65 | .value("CONSOLE_BRIDGE_LOG_NONE", ::console_bridge::CONSOLE_BRIDGE_LOG_NONE); |
| 35 | } | ||
| 36 | |||
| 37 | #endif | ||
| 38 | 65 | } | |
| 39 | } // namespace python | ||
| 40 | } // namespace pinocchio | ||
| 41 |