@@ -62,12 +62,35 @@ Functions
62
62
63
63
.. function :: flash_erase(sector_no)
64
64
65
- .. function :: osdebug(level )
65
+ .. function :: osdebug(uart_no )
66
66
67
- Turn esp os debugging messages on or off .
67
+ .. note :: This is the ESP8266 form of this function .
68
68
69
- The *level * parameter sets the threshold for the log messages for all esp components.
70
- The log levels are defined as constants:
69
+ Change the level of OS serial debug log messages. On boot,
70
+ OS serial debug log messages are disabled.
71
+
72
+ ``uart_no `` is the number of the UART peripheral which should receive
73
+ OS-level output, or ``None `` to disable OS serial debug log messages.
74
+
75
+ .. function :: osdebug(uart_no, [level])
76
+ :no-index:
77
+
78
+ .. note :: This is the ESP32 form of this function.
79
+
80
+ Change the level of OS serial debug log messages. On boot, OS
81
+ serial debug log messages are limited to Error output only.
82
+
83
+ The behaviour of this function depends on the arguments passed to it. The
84
+ following combinations are supported:
85
+
86
+ ``osdebug(None) `` restores the default OS debug log message level
87
+ (``LOG_ERROR ``).
88
+
89
+ ``osdebug(0) `` enables all available OS debug log messages (in the
90
+ default build configuration this is ``LOG_INFO ``).
91
+
92
+ ``osdebug(0, level) `` sets the OS debug log message level to the
93
+ specified value. The log levels are defined as constants:
71
94
72
95
* ``LOG_NONE `` -- No log output
73
96
* ``LOG_ERROR `` -- Critical errors, software module can not recover on its own
@@ -77,6 +100,15 @@ Functions
77
100
* ``LOG_VERBOSE `` -- Bigger chunks of debugging information, or frequent messages
78
101
which can potentially flood the output
79
102
103
+ .. note :: ``LOG_DEBUG`` and ``LOG_VERBOSE`` are not compiled into the
104
+ MicroPython binary by default, to save size. A custom build with a
105
+ modified "``sdkconfig ``" source file is needed to see any output
106
+ at these log levels.
107
+
108
+ .. note :: Log output on ESP32 is automatically suspended in "Raw REPL" mode,
109
+ to prevent communications issues. This means OS level logging is never
110
+ seen when using ``mpremote run `` and similar tools.
111
+
80
112
.. function :: set_native_code_location(start, length)
81
113
82
114
**Note **: ESP8266 only
0 commit comments