Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
aidge
aidge_core
Commits
229208a0
Commit
229208a0
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Added Python binding
parent
7d9a0c8a
No related branches found
No related tags found
2 merge requests
!105
version 0.2.0
,
!90
Introduce Aidge::Log facility for messages logging
Pipeline
#40630
passed
1 year ago
Stage: static_analysis
Stage: build
Stage: test
Stage: coverage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python_binding/pybind_core.cpp
+2
-0
2 additions, 0 deletions
python_binding/pybind_core.cpp
python_binding/utils/pybind_Log.cpp
+103
-0
103 additions, 0 deletions
python_binding/utils/pybind_Log.cpp
with
105 additions
and
0 deletions
python_binding/pybind_core.cpp
+
2
−
0
View file @
229208a0
...
@@ -23,6 +23,7 @@ void init_DataProvider(py::module&);
...
@@ -23,6 +23,7 @@ void init_DataProvider(py::module&);
void
init_Tensor
(
py
::
module
&
);
void
init_Tensor
(
py
::
module
&
);
void
init_OperatorImpl
(
py
::
module
&
);
void
init_OperatorImpl
(
py
::
module
&
);
void
init_Attributes
(
py
::
module
&
);
void
init_Attributes
(
py
::
module
&
);
void
init_Log
(
py
::
module
&
);
void
init_Operator
(
py
::
module
&
);
void
init_Operator
(
py
::
module
&
);
void
init_OperatorTensor
(
py
::
module
&
);
void
init_OperatorTensor
(
py
::
module
&
);
...
@@ -85,6 +86,7 @@ void init_Aidge(py::module& m){
...
@@ -85,6 +86,7 @@ void init_Aidge(py::module& m){
init_OperatorImpl
(
m
);
init_OperatorImpl
(
m
);
init_Attributes
(
m
);
init_Attributes
(
m
);
init_Log
(
m
);
init_Operator
(
m
);
init_Operator
(
m
);
init_OperatorTensor
(
m
);
init_OperatorTensor
(
m
);
init_Add
(
m
);
init_Add
(
m
);
...
...
This diff is collapsed.
Click to expand it.
python_binding/utils/pybind_Log.cpp
0 → 100644
+
103
−
0
View file @
229208a0
#include
<pybind11/pybind11.h>
#include
"aidge/utils/Log.hpp"
namespace
py
=
pybind11
;
namespace
Aidge
{
void
init_Log
(
py
::
module
&
m
){
py
::
enum_
<
Log
::
Level
>
(
m
,
"Level"
)
.
value
(
"Debug"
,
Log
::
Debug
)
.
value
(
"Info"
,
Log
::
Info
)
.
value
(
"Notice"
,
Log
::
Notice
)
.
value
(
"Warn"
,
Log
::
Warn
)
.
value
(
"Error"
,
Log
::
Error
)
.
value
(
"Fatal"
,
Log
::
Fatal
);
py
::
class_
<
Log
>
(
m
,
"Log"
)
.
def_static
(
"debug"
,
[](
const
std
::
string
&
msg
)
{
Log
::
debug
(
msg
);
},
py
::
arg
(
"msg"
),
R"mydelimiter(
Detailed messages for debugging purposes, providing information helpful
for developers to trace and identify issues.
Detailed insights of what is appening in an operation, not useful for the
end-user. The operation is performed nominally.
Note: This level is disabled at compile time for Release, therefore
inducing no runtime overhead for Release.
:param msg: Debug message.
:type msg: str
)mydelimiter"
)
.
def_static
(
"info"
,
[](
const
std
::
string
&
msg
)
{
Log
::
info
(
msg
);
},
py
::
arg
(
"msg"
),
R"mydelimiter(
Messages that provide a record of the normal operation, about
the application's state, progress, or important events.
Reports normal start, end and key steps in an operation. The operation is
performed nominally.
:param msg: Info message.
:type msg: str
)mydelimiter"
)
.
def_static
(
"notice"
,
[](
const
std
::
string
&
msg
)
{
Log
::
notice
(
msg
);
},
py
::
arg
(
"msg"
),
R"mydelimiter(
Applies to normal but significant conditions that may require monitoring,
like unusual or normal fallback events.
Reports specific paths in an operation. The operation can still be
performed normally.
:param msg: Notice message.
:type msg: str
)mydelimiter"
)
.
def_static
(
"warn"
,
[](
const
std
::
string
&
msg
)
{
Log
::
warn
(
msg
);
},
py
::
arg
(
"msg"
),
R"mydelimiter(
Indicates potential issues or situations that may lead to errors but do
not necessarily cause immediate problems.
Some specific steps of the operation could not be performed, but it can
still provide an exploitable result.
:param msg: Warning message.
:type msg: str
)mydelimiter"
)
.
def_static
(
"error"
,[](
const
std
::
string
&
msg
)
{
Log
::
error
(
msg
);
},
py
::
arg
(
"msg"
),
R"mydelimiter(
Signifies a problem or unexpected condition that the application can
recover from, but attention is needed to prevent further issues.
The operation could not be performed, but it does not prevent potential
further operations.
:param msg: Error message.
:type msg: str
)mydelimiter"
)
.
def_static
(
"fatal"
,
[](
const
std
::
string
&
msg
)
{
Log
::
fatal
(
msg
);
},
py
::
arg
(
"msg"
),
R"mydelimiter(
Represents a critical error or condition that leads to the termination of
the application, indicating a severe and unrecoverable problem.
The operation could not be performed and any further operation is
impossible.
:param msg: Fatal message.
:type msg: str
)mydelimiter"
)
.
def_static
(
"setConsoleLevel"
,
&
Log
::
setConsoleLevel
,
py
::
arg
(
"level"
),
R"mydelimiter(
Set the minimum log level displayed in the console.
:param level: Log level.
:type level: Level
)mydelimiter"
)
.
def_static
(
"setFileLevel"
,
&
Log
::
setFileLevel
,
py
::
arg
(
"level"
),
R"mydelimiter(
Set the minimum log level saved in the log file.
:param level: Log level.
:type level: Level
)mydelimiter"
)
.
def_static
(
"setFileName"
,
&
Log
::
setFileName
,
py
::
arg
(
"fileName"
),
R"mydelimiter(
Set the log file name.
Close the current log file and open the one with the new file name.
If empty, stop logging into a file.
:param fileName: Log file name.
:type fileName: str
)mydelimiter"
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment