Skip to content

Commit

Permalink
Add log level to MGOS_EVENT_LOG
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Jan 24, 2020
1 parent ff1db75 commit c8b8fc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions include/mgos_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
* limitations under the License.
*/

#ifndef CS_FW_INCLUDE_MGOS_DEBUG_H_
#define CS_FW_INCLUDE_MGOS_DEBUG_H_
#pragma once

#include <stdbool.h>
#include <stdlib.h>

#include "mgos_init.h"
#include "common/cs_dbg.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif

#ifndef MGOS_DEBUG_UART_BAUD_RATE
#define MGOS_DEBUG_UART_BAUD_RATE 115200
Expand All @@ -38,6 +37,7 @@ extern "C" {
*/
struct mgos_debug_hook_arg {
int fd;
enum cs_log_level level;
const void *data;
size_t len;

Expand Down Expand Up @@ -97,5 +97,3 @@ bool mgos_debug_uart_custom_cfg(int uart_no, struct mgos_uart_config *cfg);
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* CS_FW_INCLUDE_MGOS_DEBUG_H_ */
1 change: 1 addition & 0 deletions src/mgos_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void mgos_debug_write(int fd, const void *data, size_t len) {
struct mgos_debug_hook_arg arg = {
.buf = buf,
.fd = fd,
.level = cs_log_cur_msg_level,
.data = data,
.len = len,
};
Expand Down

0 comments on commit c8b8fc2

Please sign in to comment.