Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add get_log_level #81

Merged
merged 3 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions binc/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ void log_set_level(LogLevel level) {
LogSettings.level = level;
}

LogLevel log_get_level(void) {
return LogSettings.level;
}

void log_set_handler(LogEventCallback callback) {
LogSettings.logCallback = callback;
}
Expand Down
2 changes: 2 additions & 0 deletions binc/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ void log_log_at_level(LogLevel level, const char* tag, const char *format, ...);

void log_set_level(LogLevel level);

LogLevel log_get_level(void);

void log_set_filename(const char* filename, unsigned long max_size, unsigned int max_files);

typedef void (*LogEventCallback)(LogLevel level, const char *tag, const char *message);
Expand Down
Loading