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
Merge requests
!382
Adding logger module to advligorts
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Adding logger module to advligorts
ezekiel.dohmen/advligorts:logger-module-parts
into
master
Overview
0
Commits
4
Pipelines
0
Changes
1
Merged
Ezekiel Dohmen
requested to merge
ezekiel.dohmen/advligorts:logger-module-parts
into
master
2 years ago
Overview
0
Commits
4
Pipelines
0
Changes
1
Expand
Not adding code to use it yet.
0
0
Merge request reports
Viewing commit
77def14c
Prev
Next
Show latest version
1 file
+
64
−
13
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
77def14c
Adding more comments
· 77def14c
Ezekiel Dohmen
authored
2 years ago
src/include/drv/rts-logger.h
+
64
−
13
Options
@@ -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
Loading