log: add common helper log_set_target_and_open()
quite often we want to set a log target and immediately open it. Add a common helper for that.
This commit is contained in:
@@ -347,6 +347,11 @@ void log_set_target(LogTarget target) {
|
||||
log_target = target;
|
||||
}
|
||||
|
||||
void log_set_target_and_open(LogTarget target) {
|
||||
log_set_target(target);
|
||||
log_open();
|
||||
}
|
||||
|
||||
void log_close(void) {
|
||||
/* Do not call from library code. */
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ static inline void clear_log_syntax_callback(dummy_t *dummy) {
|
||||
const char *log_target_to_string(LogTarget target) _const_;
|
||||
LogTarget log_target_from_string(const char *s) _pure_;
|
||||
void log_set_target(LogTarget target);
|
||||
void log_set_target_and_open(LogTarget target);
|
||||
int log_set_target_from_string(const char *e);
|
||||
LogTarget log_get_target(void) _pure_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user