--- /dev/null
+#pragma once
+
+// C
+#include <stdbool.h>
+
+// POSIX
+#include <pthread.h>
+
+// DLog
+#include <dlog.h>
+
+struct log_config;
+
+extern int (*write_to_log)(log_id_t, log_priority, const char *tag, const char *msg);
+extern pthread_mutex_t log_init_lock;
+extern bool limiter;
+
+void __update_plog(const struct log_config *conf);
+
+#ifdef UNIT_TEST
+void __dlog_fini(void);
+void __configure(void);
+#endif
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+// C
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+// POSIX
#include <limits.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/inotify.h>
+// DLog
#include <dynamic_config.h>
+#include <libdlog.h>
#include <logcommon.h>
#include <logconfig.h>
#include <loglimiter.h>
static typeof(((struct inotify_event *)0)->wd) inotify_wd = -1;
static char *inotify_path;
-extern pthread_mutex_t log_init_lock;
-extern bool limiter;
-extern void __update_plog(const struct log_config *conf);
-
static bool __setup_runtime_watch(char const *path)
{
assert(path);
* limitations under the License.
*/
-#include <pthread.h>
-#include <stdlib.h>
+// C
+#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
+#include <stdlib.h>
+
+// POSIX
+#include <pthread.h>
+#include <unistd.h>
+// DLog
#include <dynamic_config.h>
+#include <libdlog.h>
#include <logcommon.h>
-#include "loglimiter.h"
#include "logconfig.h"
-#include <assert.h>
-#include <unistd.h>
+#include "loglimiter.h"
#define DEFAULT_CONFIG_LIMITER false
#define DEFAULT_CONFIG_PLOG true
bool plog[LOG_ID_MAX];
bool plog_default_values[LOG_ID_MAX];
-void __update_plog(const struct log_config *conf);
-
static int debugmode;
static int fatal_assert;
static int limiter_apply_to_all_buffers;
+// C
#include <stdio.h>
+
+// POSIX
#include <fcntl.h>
#include <time.h>
#include <sys/socket.h>
+// DLog
+#include <libdlog.h>
#include <logcommon.h>
#include <logconfig.h>
-extern int (*write_to_log)(log_id_t, log_priority, const char *tag, const char *msg);
-
/* TODO: initialize in for loop to be sure of initializing all items */
static int log_fds[(int)LOG_ID_MAX] = { -1, -1, -1, -1, -1, -1 };
-#include <sys/socket.h>
-#include <signal.h>
+// C
+#include <assert.h>
#include <stdio.h>
+
+// POSIX
+#include <signal.h>
#include <linux/limits.h>
+#include <sys/socket.h>
#include <sys/un.h>
+
+// DLog
+#include <libdlog.h>
+#include <logconfig.h>
#include <logpipe.h>
#include <logprint.h>
-#include <logconfig.h>
-#include <assert.h>
-
-extern int (*write_to_log)(log_id_t, log_priority, const char *tag, const char *msg);
-extern pthread_mutex_t log_init_lock;
/* TODO: initialize in for loop to be sure of initializing all items */
static int pipe_fd[LOG_ID_MAX] = {-1, -1, -1, -1, -1, -1};
static char log_pipe_path[LOG_ID_MAX][PATH_MAX];
// DLog
#include <dlog.h>
+#include <libdlog.h>
#include <logconfig.h>
-extern int (*write_to_log)(log_id_t, log_priority, const char *tag, const char *msg);
-void __dlog_fini(void);
-void __configure(void);
-
void __log_limiter_update(struct log_config *config) { }
void __log_limiter_destroy(void) { }
void __dynamic_config_destroy() { }