File tree Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -1374,6 +1374,7 @@ config DEBUG_SECUREFAULT
1374
1374
config ARM_SEMIHOSTING_SYSLOG
1375
1375
bool "Semihosting SYSLOG support"
1376
1376
select ARCH_SYSLOG
1377
+ select SYSLOG_REGISTER
1377
1378
---help---
1378
1379
Enable hooks to support semihosting syslog output.
1379
1380
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ if !ARCH_SYSLOG
196
196
config SYSLOG_CHAR
197
197
bool "Log to a character device"
198
198
default n
199
+ select SYSLOG_REGISTER
199
200
---help---
200
201
Enable the generic character device for the SYSLOG. The full path to the
201
202
SYSLOG device is provided by SYSLOG_DEVPATH. A valid character device (or
@@ -231,6 +232,7 @@ config SYSLOG_CONSOLE
231
232
bool "Log to /dev/console"
232
233
default !ARCH_LOWPUTC && !SYSLOG_CHAR && !RAMLOG_SYSLOG && !SYSLOG_RPMSG && !SYSLOG_RTT
233
234
depends on DEV_CONSOLE
235
+ select SYSLOG_REGISTER
234
236
---help---
235
237
Use the system console as a SYSLOG output device.
236
238
@@ -291,6 +293,7 @@ config SYSLOG_RPMSG_SERVER_CHARDEV
291
293
menuconfig SYSLOG_FILE
292
294
bool "Syslog file output"
293
295
default n
296
+ select SYSLOG_REGISTER
294
297
---help---
295
298
Build in support to use a file to collect SYSLOG output. File SYSLOG
296
299
channels differ from other SYSLOG channels in that they cannot be
@@ -375,4 +378,9 @@ config SYSLOG_IOCTL
375
378
commands are SYSLOGIOC_SETFILTER/SYSLOGIOC_GETCHANNELS, which can be
376
379
used to set the enable status of different channels
377
380
381
+ config SYSLOG_REGISTER
382
+ bool "Register syslog channel support"
383
+ ---help---
384
+ This option will support register the syslog channel dynamically.
385
+
378
386
endmenu # System logging
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ extern "C"
47
47
* g_default_channel.
48
48
*/
49
49
50
- EXTERN FAR syslog_channel_t * g_syslog_channel [CONFIG_SYSLOG_MAX_CHANNELS ];
50
+ EXTERN FAR syslog_channel_t *
51
+ #ifndef CONFIG_SYSLOG_REGISTER
52
+ const
53
+ #endif
54
+ g_syslog_channel [CONFIG_SYSLOG_MAX_CHANNELS ];
51
55
52
56
/****************************************************************************
53
57
* Public Function Prototypes
Original file line number Diff line number Diff line change @@ -191,8 +191,11 @@ static syslog_channel_t g_default_channel =
191
191
192
192
/* This is the current syslog channel in use */
193
193
194
- FAR syslog_channel_t
195
- * g_syslog_channel [CONFIG_SYSLOG_MAX_CHANNELS ] =
194
+ FAR syslog_channel_t *
195
+ #ifndef CONFIG_SYSLOG_REGISTER
196
+ const
197
+ #endif
198
+ g_syslog_channel [CONFIG_SYSLOG_MAX_CHANNELS ] =
196
199
{
197
200
#if defined(CONFIG_SYSLOG_DEFAULT )
198
201
& g_default_channel ,
@@ -272,6 +275,7 @@ static ssize_t syslog_default_write(FAR syslog_channel_t *channel,
272
275
*
273
276
****************************************************************************/
274
277
278
+ #ifdef CONFIG_SYSLOG_REGISTER
275
279
int syslog_channel_register (FAR syslog_channel_t * channel )
276
280
{
277
281
#if (CONFIG_SYSLOG_MAX_CHANNELS != 1 )
@@ -369,3 +373,4 @@ int syslog_channel_unregister(FAR syslog_channel_t *channel)
369
373
370
374
return - EINVAL ;
371
375
}
376
+ #endif
You can’t perform that action at this time.
0 commit comments