-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from dic-iit/feature/set_verbosity
Allow changing the log verbosity
- Loading branch information
Showing
10 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (C) 2021 Istituto Italiano di Tecnologia (IIT). All rights reserved. | ||
# This software may be modified and distributed under the terms of the | ||
# GNU Lesser General Public License v2.1 or any later version. | ||
|
||
set(H_PREFIX include/BipedalLocomotion/bindings/TextLogging) | ||
|
||
add_bipedal_locomotion_python_module( | ||
NAME TextLogging | ||
SOURCES | ||
src/Module.cpp | ||
src/TextLogging.cpp | ||
HEADERS | ||
${H_PREFIX}/Module.h | ||
${H_PREFIX}/TextLogging.h | ||
LINK_LIBRARIES | ||
BipedalLocomotion::TextLogging | ||
) |
18 changes: 18 additions & 0 deletions
18
bindings/python/TextLogging/include/BipedalLocomotion/bindings/TextLogging/Module.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* @file Module.h | ||
* @authors Diego Ferigo | ||
* @copyright 2021 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the GNU Lesser General Public License v2.1 or any later version. | ||
*/ | ||
|
||
#ifndef BIPEDAL_LOCOMOTION_BINDINGS_TEXT_LOGGING_MODULE_H | ||
#define BIPEDAL_LOCOMOTION_BINDINGS_TEXT_LOGGING_MODULE_H | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace BipedalLocomotion::bindings::TextLogging | ||
{ | ||
void CreateModule(pybind11::module& module); | ||
} // namespace BipedalLocomotion::bindings::TextLogging | ||
|
||
#endif // BIPEDAL_LOCOMOTION_BINDINGS_TEXT_LOGGING_MODULE_H |
18 changes: 18 additions & 0 deletions
18
bindings/python/TextLogging/include/BipedalLocomotion/bindings/TextLogging/TextLogging.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* @file TextLogging.h | ||
* @authors Diego Ferigo | ||
* @copyright 2021 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the GNU Lesser General Public License v2.1 or any later version. | ||
*/ | ||
|
||
#ifndef BIPEDAL_LOCOMOTION_BINDINGS_TEXT_LOGGING_H | ||
#define BIPEDAL_LOCOMOTION_BINDINGS_TEXT_LOGGING_H | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
namespace BipedalLocomotion::bindings::TextLogging | ||
{ | ||
void CreateTextLogging(pybind11::module& module); | ||
} // namespace BipedalLocomotion::bindings::TextLogging | ||
|
||
#endif // BIPEDAL_LOCOMOTION_BINDINGS_TEXT_LOGGING_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* @file Module.cpp | ||
* @authors Diego Ferigo | ||
* @copyright 2021 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the GNU Lesser General Public License v2.1 or any later version. | ||
*/ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
#include "BipedalLocomotion/bindings/TextLogging/Module.h" | ||
#include "BipedalLocomotion/bindings/TextLogging/TextLogging.h" | ||
|
||
namespace BipedalLocomotion::bindings::TextLogging | ||
{ | ||
void CreateModule(pybind11::module& module) | ||
{ | ||
module.doc() = "Text logging module"; | ||
CreateTextLogging(module); | ||
} | ||
} // namespace BipedalLocomotion::bindings::TextLogging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @file TextLogging.cpp | ||
* @authors Diego Ferigo | ||
* @copyright 2021 Istituto Italiano di Tecnologia (IIT). This software may be modified and | ||
* distributed under the terms of the GNU Lesser General Public License v2.1 or any later version. | ||
*/ | ||
|
||
#include "BipedalLocomotion/bindings/TextLogging/TextLogging.h" | ||
#include "BipedalLocomotion/TextLogging/Logger.h" | ||
|
||
namespace BipedalLocomotion::bindings::TextLogging | ||
{ | ||
void CreateTextLogging(pybind11::module& module) | ||
{ | ||
namespace py = ::pybind11; | ||
using namespace BipedalLocomotion::TextLogging; | ||
|
||
py::enum_<Verbosity>(module, "Verbosity", py::arithmetic()) | ||
.value("Trace", Verbosity::Trace) | ||
.value("Debug", Verbosity::Debug) | ||
.value("Info", Verbosity::Info) | ||
.value("Warn", Verbosity::Warn) | ||
.value("Err", Verbosity::Err) | ||
.value("Critical", Verbosity::Critical) | ||
.value("Off", Verbosity::Off); | ||
|
||
module.def("set_verbosity", &setVerbosity, py::arg("verbosity")); | ||
} | ||
} // namespace BipedalLocomotion::bindings::TextLogging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters