Adhere to coding style in logging module (struct uc_log_destination->
struct UCLogDestination, and similar for other structs)
This commit is contained in:
+21
-21
@@ -18,7 +18,7 @@
|
||||
* IO
|
||||
*};
|
||||
*
|
||||
* struct uc_log_module modules[] = {
|
||||
* struct UCLogModule modules[] = {
|
||||
* {
|
||||
* .id = POLLER,
|
||||
* .short_name = "POLLER",
|
||||
@@ -38,7 +38,7 @@
|
||||
* .log_level == UC_LL_DEBUG
|
||||
* }
|
||||
* };
|
||||
* struct uc_log_modules m = {
|
||||
* struct UCLogModules m = {
|
||||
* .mods = modules,
|
||||
* .cnt = ARRAY_SIZE(modules)
|
||||
* };
|
||||
@@ -100,13 +100,13 @@ enum UC_LOG_DESTINATION {
|
||||
* and allow the log message to identigy which module the
|
||||
* log message originates from
|
||||
*/
|
||||
struct uc_log_module {
|
||||
struct UCLogModule {
|
||||
/** The id of the log module.
|
||||
* This is the id one specifies in the various log
|
||||
* functions/macros.
|
||||
* Within the struct uc_log_modules, this id must start
|
||||
* Within the struct UCLogModules, this id must start
|
||||
* at 0 and be incremented consecutively, being equal
|
||||
* to the index within struct uc_log_modules.mods
|
||||
* to the index within struct UCLogModules.mods
|
||||
*/
|
||||
int id;
|
||||
|
||||
@@ -122,15 +122,15 @@ struct uc_log_module {
|
||||
int log_level;
|
||||
};
|
||||
|
||||
/* A collection of struct uc_log_module */
|
||||
struct uc_log_modules {
|
||||
/* A collection of struct UCLogModule */
|
||||
struct UCLogModules {
|
||||
/* Pointer to the first element of the array */
|
||||
struct uc_log_module *mods;
|
||||
struct UCLogModule *mods;
|
||||
/** The number of elements in the mods array. */
|
||||
int cnt;
|
||||
};
|
||||
|
||||
struct uc_log_destination;
|
||||
struct UCLogDestination;
|
||||
|
||||
|
||||
/* Returns a string representation of the log level.
|
||||
@@ -150,7 +150,7 @@ const char *uc_ll_2_str(enum UC_LOG_LEVEL l);
|
||||
* @return An opaque uc_log_destination that can be added as a destination to
|
||||
* the ucore logging system
|
||||
*/
|
||||
struct uc_log_destination *uc_log_new_stderr(int log_level, int log_location);
|
||||
struct UCLogDestination *uc_log_new_stderr(int log_level, int log_location);
|
||||
|
||||
/* creates a new uc_log_destination for logging to syslog
|
||||
*
|
||||
@@ -163,7 +163,7 @@ struct uc_log_destination *uc_log_new_stderr(int log_level, int log_location);
|
||||
* @return An opaque uc_log_destination that can be added as a destination to
|
||||
* the ucore logging system
|
||||
*/
|
||||
struct uc_log_destination *uc_log_new_syslog(const char *ident, int facility, int log_level, int log_location);
|
||||
struct UCLogDestination *uc_log_new_syslog(const char *ident, int facility, int log_level, int log_location);
|
||||
|
||||
/* creates a new uc_log_destination for printing on stderr.
|
||||
*
|
||||
@@ -174,13 +174,13 @@ struct uc_log_destination *uc_log_new_syslog(const char *ident, int facility, in
|
||||
* @param return An opaque uc_log_destination that can be added as a destination to
|
||||
* the ucore logging system
|
||||
*/
|
||||
struct uc_log_destination *uc_log_new_file(const char *filename, int log_level, int log_location);
|
||||
struct UCLogDestination *uc_log_new_file(const char *filename, int log_level, int log_location);
|
||||
|
||||
/** Add a uc_log_destination to the logging system.
|
||||
*
|
||||
* @param dest The uc_log_destination to add.
|
||||
*/
|
||||
void uc_log_add_destination(struct uc_log_destination *dest);
|
||||
void uc_log_add_destination(struct UCLogDestination *dest);
|
||||
|
||||
/** Remove a log destination.
|
||||
* Note that this does not free the destination, it can be readded later.
|
||||
@@ -188,14 +188,14 @@ void uc_log_add_destination(struct uc_log_destination *dest);
|
||||
*
|
||||
* @param dest The uc_log_destination to remove.
|
||||
*/
|
||||
void uc_log_remove_destination(struct uc_log_destination *dest);
|
||||
void uc_log_remove_destination(struct UCLogDestination *dest);
|
||||
|
||||
/** Change the log level of a destination..
|
||||
*
|
||||
* @param dest destination for which to set the log level
|
||||
* @param level The new log level
|
||||
*/
|
||||
void uc_log_destination_set_loglevel(struct uc_log_destination *dest, enum UC_LOG_LEVEL level);
|
||||
void uc_log_destination_set_loglevel(struct UCLogDestination *dest, enum UC_LOG_LEVEL level);
|
||||
|
||||
/** Change whether to log the location (file/line no.) of logging
|
||||
* output on a destination,
|
||||
@@ -203,7 +203,7 @@ void uc_log_destination_set_loglevel(struct uc_log_destination *dest, enum UC_LO
|
||||
* @param dest log destination to change
|
||||
* @param log_location 1=log the locaton, 0=don't log the location
|
||||
*/
|
||||
void uc_log_destination_set_log_location(struct uc_log_destination *dest, int log_location);
|
||||
void uc_log_destination_set_log_location(struct UCLogDestination *dest, int log_location);
|
||||
/** Remove and free a destination.
|
||||
* This frees the memory allocated to the destination. For
|
||||
* UC_LDEST_FILE the log file is closed.
|
||||
@@ -214,7 +214,7 @@ void uc_log_destination_set_log_location(struct uc_log_destination *dest, int lo
|
||||
*
|
||||
* @param dest The destination to delete.
|
||||
*/
|
||||
void uc_log_delete_destination(struct uc_log_destination *dest);
|
||||
void uc_log_delete_destination(struct UCLogDestination *dest);
|
||||
|
||||
|
||||
/** Set the log level for a particular module on this destination
|
||||
@@ -224,7 +224,7 @@ void uc_log_delete_destination(struct uc_log_destination *dest);
|
||||
* @param log_level new log level to set for the module
|
||||
*/
|
||||
void uc_log_destination_set_module_loglevel(
|
||||
struct uc_log_destination *dest,
|
||||
struct UCLogDestination *dest,
|
||||
int module,
|
||||
enum UC_LOG_LEVEL log_level
|
||||
);
|
||||
@@ -238,7 +238,7 @@ void uc_log_destination_set_module_loglevel(
|
||||
*
|
||||
* SHORT_NAME_1=LEVEL:SHORT_NAME_2=LEVEL:SHORT_NAME_N=LEVEL
|
||||
*
|
||||
* The SHORT_NAME_N is the .short_name within a struct uc_log_module
|
||||
* The SHORT_NAME_N is the .short_name within a struct UCLogModule
|
||||
* LEVEL is one of DEBUG, INFO, WARNING, ERROR or NONE
|
||||
* Example:
|
||||
* DB=DEBUG:IO=ERROR:POLLER=INFO
|
||||
@@ -250,7 +250,7 @@ void uc_log_destination_set_module_loglevel(
|
||||
* @parama log_mask the log mask as described above to set.
|
||||
*/
|
||||
void uc_log_destination_set_mask(
|
||||
struct uc_log_destination *dest,
|
||||
struct UCLogDestination *dest,
|
||||
const char *log_mask
|
||||
);
|
||||
|
||||
@@ -266,7 +266,7 @@ int uc_log_reopen_files(void);
|
||||
*
|
||||
* @param user_struct containing an array of all the modules defined by the application.
|
||||
*/
|
||||
void uc_log_init(struct uc_log_modules *user_modules);
|
||||
void uc_log_init(struct UCLogModules *user_modules);
|
||||
|
||||
void uc_logf(int log_level, int module, int raw,
|
||||
const char *location, const char *fmt, ...)
|
||||
|
||||
Reference in New Issue
Block a user