Skip to content

Commit

Permalink
Changed language binding accordingly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peguen committed Dec 11, 2024
1 parent 8fe56f5 commit 2af39ae
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 41 deletions.
2 changes: 1 addition & 1 deletion lang/csharp/Continental.eCAL.Core/ecal_clr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void Logger::SetLogLevel(LogLevel level_)

void Logger::Log(System::String^ message_)
{
::eCAL::Logging::Log(StringToStlString(message_));
::eCAL::Logging::Log(log_level_info, StringToStlString(message_));
}


Expand Down
3 changes: 2 additions & 1 deletion lang/python/core/ecal/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ def log_setlevel(level):
:type level: int
"""
return _ecal.log_setlevel(level)
print("[WARNING] 'log_setlevel(int)' is deprecated. All logs will have the log level 'all' until the new API is introduced.")
return None


def log_setcoretime(time):
Expand Down
12 changes: 2 additions & 10 deletions lang/python/core/src/ecal_clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,12 @@ bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int
return(ret);
}

/****************************************/
/* log_setlevel */
/****************************************/
void log_setlevel(const int level_)
{
eCAL::Logging::SetLogLevel(eCAL_Logging_eLogLevel(level_));
}

/****************************************/
/* log_message */
/****************************************/
void log_message(const char* message_)
void log_message(const int level_, const char* message_)
{
eCAL::Logging::Log(message_);
eCAL::Logging::Log(eCAL_Logging_eLogLevel(level_), message_);
}


Expand Down
12 changes: 1 addition & 11 deletions lang/python/core/src/ecal_clang.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,12 @@ bool ecal_get_type_encoding(const char* topic_name_, const char** topic_encoding
**/
bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int* topic_desc_len_);

/*************************************************************************/
/* logging */
/*************************************************************************/
/**
* @brief Sets the log level.
*
* @param level_ The level.
**/
void log_setlevel(int level_);

/**
* @brief Log a message (with current log level).
*
* @param message_ The log message string.
**/
void log_message(const char* message_);
void log_message(int level_, const char* message_);

/*************************************************************************/
/* publisher */
Expand Down
19 changes: 1 addition & 18 deletions lang/python/core/src/ecal_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -227,21 +227,6 @@ PyObject* shutdown_processes(PyObject* /*self*/, PyObject* /*args*/)
Py_RETURN_NONE;
}

/****************************************/
/* log_setlevel */
/****************************************/
PyObject* log_setlevel(PyObject* /*self*/, PyObject* args)
{
int level = 0;

if (!PyArg_ParseTuple(args, "i", &level))
return nullptr;

log_setlevel(level);

Py_RETURN_NONE;
}

/****************************************/
/* log_message */
/****************************************/
Expand All @@ -252,12 +237,11 @@ PyObject* log_message(PyObject* /*self*/, PyObject* args)
if (!PyArg_ParseTuple(args, "s", &message))
return nullptr;

log_message(message);
log_message(255, message);

Py_RETURN_NONE;
}


/****************************************/
/* pub_create */
/****************************************/
Expand Down Expand Up @@ -1322,7 +1306,6 @@ static PyMethodDef _ecal_methods[] =
{"shutdown_process_uname", shutdown_process_uname, METH_VARARGS, "shutdown_process_uname(unit_name)"},
{"shutdown_processes", shutdown_processes, METH_NOARGS, "shutdown_processes()"},

{"log_setlevel", log_setlevel, METH_VARARGS, "log_setlevel(level)"},
{"log_message", log_message, METH_VARARGS, "log_message(message)"},

{"pub_create", pub_create, METH_VARARGS, "pub_create(topic_name, topic_type, topic_encoding, topic_desc)"},
Expand Down

0 comments on commit 2af39ae

Please sign in to comment.