Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
50e8c729
Commit
50e8c729
authored
1 year ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Include logger in compilation.
parent
ae30603d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/include/logging.h
+13
-2
13 additions, 2 deletions
src/include/logging.h
src/libnptm/Makefile
+3
-3
3 additions, 3 deletions
src/libnptm/Makefile
src/libnptm/logging.cpp
+6
-2
6 additions, 2 deletions
src/libnptm/logging.cpp
with
22 additions
and
7 deletions
src/include/logging.h
+
13
−
2
View file @
50e8c729
...
@@ -39,9 +39,20 @@ class Logger {
...
@@ -39,9 +39,20 @@ class Logger {
* \param error_output: `FILE *` Pointer to an output file for error messages
* \param error_output: `FILE *` Pointer to an output file for error messages
* (optional, default is `stderr`).
* (optional, default is `stderr`).
*/
*/
Logger
(
int
threshold
,
FILE
*
logging_output
=
std
::
stdout
,
FILE
*
error_output
=
std
::
stderr
);
Logger
(
int
threshold
,
FILE
*
logging_output
=
stdout
,
FILE
*
error_output
=
stderr
);
log
(
std
::
string
message
,
int
level
);
/*! \brief Print a message to the error output.
*
* \param message: `string` The message to be printed.
*/
void
err
(
std
::
string
message
);
/*! \brief Print a message, depending on its logging level.
*
* \param message: `string` The message to be printed.
* \param level: `int` The priority level (default is `LOG_INFO = 1`).
*/
void
log
(
std
::
string
message
,
int
level
=
LOG_INFO
);
};
};
#endif
#endif
This diff is collapsed.
Click to expand it.
src/libnptm/Makefile
+
3
−
3
View file @
50e8c729
...
@@ -19,11 +19,11 @@ endif
...
@@ -19,11 +19,11 @@ endif
include
../make.inc
include
../make.inc
CXX_NPTM_OBJS
=
$(
OBJDIR
)
/Commons.o
$(
OBJDIR
)
/Configuration.o
$(
OBJDIR
)
/file_io.o
$(
OBJDIR
)
/Parsers.o
$(
OBJDIR
)
/sph_subs.o
$(
OBJDIR
)
/clu_subs.o
$(
OBJDIR
)
/tfrfme.o
$(
OBJDIR
)
/tra_subs.o
$(
OBJDIR
)
/TransitionMatrix.o
$(
OBJDIR
)
/lapack_calls.o
$(
OBJDIR
)
/algebraic.o
$(
OBJDIR
)
/types.o
CXX_NPTM_OBJS
=
$(
OBJDIR
)
/Commons.o
$(
OBJDIR
)
/Configuration.o
$(
OBJDIR
)
/file_io.o
$(
OBJDIR
)
/Parsers.o
$(
OBJDIR
)
/sph_subs.o
$(
OBJDIR
)
/clu_subs.o
$(
OBJDIR
)
/tfrfme.o
$(
OBJDIR
)
/tra_subs.o
$(
OBJDIR
)
/TransitionMatrix.o
$(
OBJDIR
)
/lapack_calls.o
$(
OBJDIR
)
/algebraic.o
$(
OBJDIR
)
/types.o
$(
OBJDIR
)
/logging.o
CXX_NPTM_DYNOBJS
=
$(
DYNOBJDIR
)
/Commons.o
$(
DYNOBJDIR
)
/Configuration.o
$(
DYNOBJDIR
)
/file_io.o
$(
DYNOBJDIR
)
/Parsers.o
$(
DYNOBJDIR
)
/sph_subs.o
$(
DYNOBJDIR
)
/clu_subs.o
$(
DYNOBJDIR
)
/tfrfme.o
$(
DYNOBJDIR
)
/tra_subs.o
$(
DYNOBJDIR
)
/TransitionMatrix.o
$(
DYNOBJDIR
)
/lapack_calls.o
$(
DYNOBJDIR
)
/algebraic.o
$(
DYNOBJDIR
)
/types.o
CXX_NPTM_DYNOBJS
=
$(
DYNOBJDIR
)
/Commons.o
$(
DYNOBJDIR
)
/Configuration.o
$(
DYNOBJDIR
)
/file_io.o
$(
DYNOBJDIR
)
/Parsers.o
$(
DYNOBJDIR
)
/sph_subs.o
$(
DYNOBJDIR
)
/clu_subs.o
$(
DYNOBJDIR
)
/tfrfme.o
$(
DYNOBJDIR
)
/tra_subs.o
$(
DYNOBJDIR
)
/TransitionMatrix.o
$(
DYNOBJDIR
)
/lapack_calls.o
$(
DYNOBJDIR
)
/algebraic.o
$(
DYNOBJDIR
)
/types.o
$(
DYNOBJDIR
)
/logging.o
CXX_NPTM_DEBUG
=
$(
OBJDIR
)
/Commons.g
*
$(
OBJDIR
)
/Configuration.g
*
$(
OBJDIR
)
/file_io.g
*
$(
OBJDIR
)
/Parsers.g
*
$(
OBJDIR
)
/sph_subs.g
*
$(
OBJDIR
)
/clu_subs.g
*
$(
OBJDIR
)
/tfrfme.g
*
$(
OBJDIR
)
/tra_subs.g
*
$(
OBJDIR
)
/TransitionMatrix.g
*
$(
OBJDIR
)
/lapack_calls.g
*
$(
OBJDIR
)
/algebraic.g
*
$(
OBJDIR
)
/types.g
*
$(
DYNOBJDIR
)
/Commons.g
*
$(
DYNOBJDIR
)
/Configuration.g
*
$(
DYNOBJDIR
)
/file_io.g
*
$(
DYNOBJDIR
)
/Parsers.g
*
$(
DYNOBJDIR
)
/sph_subs.g
*
$(
DYNOBJDIR
)
/clu_subs.g
*
$(
DYNOBJDIR
)
/tfrfme.g
*
$(
DYNOBJDIR
)
/tra_subs.g
*
$(
DYNOBJDIR
)
/TransitionMatrix.g
*
$(
DYNOBJDIR
)
/lapack_calls.g
*
$(
DYNOBJDIR
)
/algebraic.g
*
$(
DYNOBJDIR
)
/types.g
*
CXX_NPTM_DEBUG
=
$(
OBJDIR
)
/Commons.g
*
$(
OBJDIR
)
/Configuration.g
*
$(
OBJDIR
)
/file_io.g
*
$(
OBJDIR
)
/Parsers.g
*
$(
OBJDIR
)
/sph_subs.g
*
$(
OBJDIR
)
/clu_subs.g
*
$(
OBJDIR
)
/tfrfme.g
*
$(
OBJDIR
)
/tra_subs.g
*
$(
OBJDIR
)
/TransitionMatrix.g
*
$(
OBJDIR
)
/lapack_calls.g
*
$(
OBJDIR
)
/algebraic.g
*
$(
OBJDIR
)
/types.g
*
$(
OBJDIR
)
/logging.g
*
$(
DYNOBJDIR
)
/Commons.g
*
$(
DYNOBJDIR
)
/Configuration.g
*
$(
DYNOBJDIR
)
/file_io.g
*
$(
DYNOBJDIR
)
/Parsers.g
*
$(
DYNOBJDIR
)
/sph_subs.g
*
$(
DYNOBJDIR
)
/clu_subs.g
*
$(
DYNOBJDIR
)
/tfrfme.g
*
$(
DYNOBJDIR
)
/tra_subs.g
*
$(
DYNOBJDIR
)
/TransitionMatrix.g
*
$(
DYNOBJDIR
)
/lapack_calls.g
*
$(
DYNOBJDIR
)
/algebraic.g
*
$(
DYNOBJDIR
)
/types.g
*
$(
DYNOBJDIR
)
/logging.g
*
all
:
$(BUILDDIR_NPTM)/libnptm.a $(BUILDDIR_NPTM)/libnptm.so
all
:
$(BUILDDIR_NPTM)/libnptm.a $(BUILDDIR_NPTM)/libnptm.so
...
...
This diff is collapsed.
Click to expand it.
src/libnptm/logging.cpp
+
6
−
2
View file @
50e8c729
...
@@ -19,9 +19,13 @@ Logger::Logger(int threshold, FILE *logging_output, FILE *error_output) {
...
@@ -19,9 +19,13 @@ Logger::Logger(int threshold, FILE *logging_output, FILE *error_output) {
err_output
=
error_output
;
err_output
=
error_output
;
}
}
Logger
::
log
(
std
::
string
message
,
int
level
)
{
void
Logger
::
err
(
std
::
string
message
)
{
fprintf
(
err_output
,
"%s
\n
"
,
message
.
c_str
());
}
void
Logger
::
log
(
std
::
string
message
,
int
level
)
{
if
(
level
==
LOG_ERRO
)
err
(
message
);
if
(
level
==
LOG_ERRO
)
err
(
message
);
else
{
else
{
if
(
level
>=
log_threshold
)
fprintf
(
log_output
,
message
);
if
(
level
>=
log_threshold
)
fprintf
(
log_output
,
"%s
\n
"
,
message
.
c_str
()
);
}
}
}
}
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