Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advLigoRTS
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
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CDS
software
advLigoRTS
Commits
77def14c
Commit
77def14c
authored
2 years ago
by
Ezekiel Dohmen
Browse files
Options
Downloads
Patches
Plain Diff
Adding more comments
parent
e83d1599
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!439
RCG 5.0 release fro deb 10
,
!387
Merge master branch into debian packaging branch
,
!382
Adding logger module to advligorts
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/include/drv/rts-logger.h
+64
-13
64 additions, 13 deletions
src/include/drv/rts-logger.h
with
64 additions
and
13 deletions
src/include/drv/rts-logger.h
+
64
−
13
View file @
77def14c
...
...
@@ -42,29 +42,67 @@ enum RTSLOG_LOG_LEVEL
// Start user functions
//
/**
* @usage This is the main interface that should be used to log messages
* from front end code infrastructure. The default log level is INFO,
* so you must set the logger level to DEBUG before you will see debug
* level messages.
*
* These macros can be used just like prink or printf:
*
* RTSLOG_INFO("A string: %s and an int: %d\n", "Hello", 5);
*
*/
#define RTSLOG_RAW(fmt, ...) rtslog_print(RTSLOG_LOG_LEVEL_RAW, fmt, ##__VA_ARGS__)
#define RTSLOG_DEBUG(fmt, ...) rtslog_print (RTSLOG_LOG_LEVEL_DEBUG, RTS_LOG_PREFIX ": DEBUG - " fmt, ##__VA_ARGS__)
#define RTSLOG_INFO(fmt, ...) rtslog_print (RTSLOG_LOG_LEVEL_INFO, RTS_LOG_PREFIX ": INFO - " fmt, ##__VA_ARGS__)
#define RTSLOG_WARN(fmt, ...) rtslog_print (RTSLOG_LOG_LEVEL_WARN, RTS_LOG_PREFIX ": WARN - " fmt, ##__VA_ARGS__)
#define RTSLOG_ERROR(fmt, ...) rtslog_print (RTSLOG_LOG_LEVEL_ERROR, RTS_LOG_PREFIX ": ERROR - " fmt, ##__VA_ARGS__)
int
rtslog_set_log_level
(
int
new_level
);
int
rtslog_get_log_level
(
void
);
int
rtslog_get_num_dropped_space
(
void
);
int
rtslog_get_num_ready_to_print
(
void
);
//
// Debugging/Stats functions
//
/**
* @brief Requests the new log level be set in the logger.
*
* When the kernel module version is being used the sysfs interface
* can be used to set this value.
*
* cat /sys/kernel/rts_logger/debug_level
*
* @param new_level The new log level to set (a RTSLOG_LOG_LEVEL)
*
* @return 1 if the log level was set, 0 if the log level was invalid
*/
int
rtslog_set_log_level
(
int
new_level
);
/**
* @brief Requests the new log level be set in the logger
*
* @return The level set (a RTSLOG_LOG_LEVEL)
*/
int
rtslog_get_log_level
(
void
);
/**
* @brief Requests number of messages that have been dropped
* due to a full buffer. This should't happen, but can
* if too many modules are spamming messages faster than
* they can be printed. This is an accumulative count
* from module insertion (kernel space), or process creation (usermode)
*
* @return The number of messages that have been dropped
*/
int
rtslog_get_num_dropped_space
(
void
);
/**
* @brief Requests number of messages that are currently
* queued, waiting for printing.
*
* @return The number of messages that are queued for print
*/
int
rtslog_get_num_ready_to_print
(
void
);
...
...
@@ -79,7 +117,20 @@ int rtslog_get_num_ready_to_print( void );
//
// Internal functions
//
/**
* @brief Don't call this function directly, use the macros above
*
* Passes the message to the logger for logging
*
* @param level The log level of this message
* @param fmt The format string of the message
* @param ... Arguments for the format string
*
* @return none
*/
void
rtslog_print
(
int
level
,
const
char
*
fmt
,
...);
#endif
#endif
//LIGO_RTS_LOGGER_H_INCLUDED
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