Skip to content

Commit a525116

Browse files
anchaoxiaoxiang781216
authored andcommitted
syslog/channel: rename syslog_channel() to syslog_channel_register()
Change syslog API naming more reasonable: 1. rename syslog_channel() to syslog_channel_register() 2. rename syslog_channel_remove() to syslog_channel_unregister() Signed-off-by: chao an <[email protected]>
1 parent 8288fe4 commit a525116

File tree

10 files changed

+46
-40
lines changed

10 files changed

+46
-40
lines changed

Documentation/components/drivers/special/syslog.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ defined in ``include/nuttx/syslog/syslog.h``:
149149
};
150150
151151
The channel interface is instantiated by calling
152-
:c:func:`syslog_channel()`.
152+
:c:func:`syslog_channel_register()`.
153153

154-
.. c:function:: int syslog_channel(FAR const struct syslog_channel_s *channel);
154+
.. c:function:: int syslog_channel_register(FAR const struct syslog_channel_s *channel);
155155
156156
Configure the SYSLOG function to use the provided
157157
channel to generate SYSLOG output.
158158
159-
``syslog_channel()`` is a non-standard, internal OS interface and
159+
``syslog_channel_register()`` is a non-standard, internal OS interface and
160160
is not available to applications. It may be called numerous times
161161
as necessary to change channel interfaces. By default, all system
162162
log output goes to console (``/dev/console``).
@@ -363,7 +363,7 @@ serial console is used and ``up_putc()`` is supported.
363363
device is used for a console -- such as a USB console or a Telnet
364364
console. The SYSLOG channel is not redirected as ``stdout`` is;
365365
the SYSLOG channel will stayed fixed (unless it is explicitly
366-
changed via ``syslog_channel()``).
366+
changed via ``syslog_channel_register()``).
367367

368368
References: ``drivers/syslog/syslog_consolechannel.c`` and
369369
``drivers/syslog/syslog_device.c``
@@ -415,9 +415,9 @@ SYSLOG file channel:
415415
at ``devpath`` as the SYSLOG channel.
416416
417417
This tiny function is simply a wrapper around
418-
``syslog_dev_initialize()`` and ``syslog_channel()``. It calls
418+
``syslog_dev_initialize()`` and ``syslog_channel_register()``. It calls
419419
``syslog_dev_initialize()`` to configure the character file at
420-
``devpath`` then calls ``syslog_channel()`` to use that device as
420+
``devpath`` then calls ``syslog_channel_register()`` to use that device as
421421
the SYSLOG output channel.
422422
423423
File SYSLOG channels differ from other SYSLOG channels in that

arch/arm/src/armv7-m/arm_itm_syslog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void itm_syslog_initialize(void)
180180

181181
/* Setup the SYSLOG channel */
182182

183-
syslog_channel(&g_itm_channel);
183+
syslog_channel_register(&g_itm_channel);
184184
}
185185

186186
#endif /* CONFIG_ARMV7M_ITMSYSLOG */

arch/arm/src/armv8-m/arm_itm_syslog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void itm_syslog_initialize(void)
180180

181181
/* Setup the SYSLOG channel */
182182

183-
syslog_channel(&g_itm_channel);
183+
syslog_channel_register(&g_itm_channel);
184184
}
185185

186186
#endif /* CONFIG_ARMV8M_ITMSYSLOG */

drivers/syslog/syslog.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ void syslog_dev_uninitialize(FAR struct syslog_channel_s *channel);
110110
* CONFIG_SYSLOG_DEVPATH as the SYSLOG channel.
111111
*
112112
* This tiny function is simply a wrapper around syslog_dev_initialize()
113-
* and syslog_channel(). It calls syslog_dev_initialize() to configure
114-
* the character device at CONFIG_SYSLOG_DEVPATH then calls
115-
* syslog_channel() to use that device as the SYSLOG output channel.
113+
* and syslog_channel_register(). It calls syslog_dev_initialize() to
114+
* configure the character device at CONFIG_SYSLOG_DEVPATH then calls
115+
* syslog_channel_register() to use that device as the SYSLOG output
116+
* channel.
116117
*
117118
* NOTE interrupt level SYSLOG output will be lost in this case unless
118119
* the interrupt buffer is used.
@@ -137,9 +138,10 @@ FAR struct syslog_channel_s *syslog_dev_channel(void);
137138
* SYSLOG channel.
138139
*
139140
* This tiny function is simply a wrapper around syslog_dev_initialize()
140-
* and syslog_channel(). It calls syslog_dev_initialize() to configure
141-
* the character device at /dev/console then calls syslog_channel() to
142-
* use that device as the SYSLOG output channel.
141+
* and syslog_channel_register(). It calls syslog_dev_initialize() to
142+
* configure the character device at /dev/console then calls
143+
* syslog_channel_register() to use that device as the SYSLOG output
144+
* channel.
143145
*
144146
* NOTE interrupt level SYSLOG output will be lost in the general case
145147
* unless the interrupt buffer is used. As a special case: If the serial

drivers/syslog/syslog_channel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static ssize_t syslog_default_write(FAR struct syslog_channel_s *channel,
272272
*
273273
****************************************************************************/
274274

275-
int syslog_channel(FAR struct syslog_channel_s *channel)
275+
int syslog_channel_register(FAR struct syslog_channel_s *channel)
276276
{
277277
#if (CONFIG_SYSLOG_MAX_CHANNELS != 1)
278278
int i;
@@ -313,7 +313,7 @@ int syslog_channel(FAR struct syslog_channel_s *channel)
313313
}
314314

315315
/****************************************************************************
316-
* Name: syslog_channel_remove
316+
* Name: syslog_channel_unregister
317317
*
318318
* Description:
319319
* Removes an already configured SYSLOG channel from the list of used
@@ -328,7 +328,7 @@ int syslog_channel(FAR struct syslog_channel_s *channel)
328328
*
329329
****************************************************************************/
330330

331-
int syslog_channel_remove(FAR struct syslog_channel_s *channel)
331+
int syslog_channel_unregister(FAR struct syslog_channel_s *channel)
332332
{
333333
int i;
334334

drivers/syslog/syslog_consolechannel.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@
5353
* SYSLOG channel.
5454
*
5555
* This tiny function is simply a wrapper around syslog_dev_initialize()
56-
* and syslog_channel(). It calls syslog_dev_initialize() to configure
57-
* the character device at /dev/console then calls syslog_channel() to
58-
* use that device as the SYSLOG output channel.
56+
* and syslog_channel_register(). It calls syslog_dev_initialize() to
57+
* configure the character device at /dev/console then calls
58+
* syslog_channel_register() to use that device as the SYSLOG output
59+
* channel.
5960
*
6061
* NOTE interrupt level SYSLOG output will be lost in the general case
6162
* unless the interrupt buffer is used. As a special case: If the serial
@@ -86,7 +87,7 @@ FAR struct syslog_channel_s *syslog_console_channel(void)
8687

8788
/* Use the character driver as the SYSLOG channel */
8889

89-
if (syslog_channel(console_channel) != OK)
90+
if (syslog_channel_register(console_channel) != OK)
9091
{
9192
syslog_dev_uninitialize(console_channel);
9293
console_channel = NULL;

drivers/syslog/syslog_devchannel.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@
5353
* SYSLOG channel.
5454
*
5555
* This tiny function is simply a wrapper around syslog_dev_initialize()
56-
* and syslog_channel(). It calls syslog_dev_initialize() to configure
57-
* the character device at CONFIG_SYSLOG_DEVPATH then calls
58-
* syslog_channel() to use that device as the SYSLOG output channel.
56+
* and syslog_channel_register(). It calls syslog_dev_initialize() to
57+
* configure the character device at CONFIG_SYSLOG_DEVPATH then calls
58+
* syslog_channel_register() to use that device as the SYSLOG output
59+
* channel.
5960
*
6061
* NOTE interrupt level SYSLOG output will be lost in this case unless
6162
* the interrupt buffer is used.
@@ -83,7 +84,7 @@ FAR struct syslog_channel_s *syslog_dev_channel(void)
8384

8485
/* Use the character driver as the SYSLOG channel */
8586

86-
if (syslog_channel(dev_channel) != OK)
87+
if (syslog_channel_register(dev_channel) != OK)
8788
{
8889
syslog_dev_uninitialize(dev_channel);
8990
dev_channel = NULL;

drivers/syslog/syslog_filechannel.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ static void log_rotate(FAR const char *log_file)
137137
* SYSLOG channel.
138138
*
139139
* This tiny function is simply a wrapper around syslog_dev_initialize()
140-
* and syslog_channel(). It calls syslog_dev_initialize() to configure
141-
* the character file at 'devpath then calls syslog_channel() to use that
142-
* device as the SYSLOG output channel.
140+
* and syslog_channel_register(). It calls syslog_dev_initialize() to
141+
* configure the character file at 'devpath then calls
142+
* syslog_channel_register() to use that device as the SYSLOG output
143+
* channel.
143144
*
144145
* File SYSLOG channels differ from other SYSLOG channels in that they
145146
* cannot be established until after fully booting and mounting the target
@@ -203,7 +204,7 @@ FAR struct syslog_channel_s *syslog_file_channel(FAR const char *devpath)
203204
* screwed.
204205
*/
205206

206-
if (syslog_channel(file_channel) != OK)
207+
if (syslog_channel_register(file_channel) != OK)
207208
{
208209
syslog_dev_uninitialize(file_channel);
209210
file_channel = NULL;

drivers/syslog/syslog_initialize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
* This function performs these basic operations:
5151
*
5252
* - Initialize the SYSLOG device
53-
* - Call syslog_channel() to begin using that device.
53+
* - Call syslog_channel_register() to begin using that device.
5454
*
5555
* If CONFIG_ARCH_SYSLOG is selected, then the architecture-specifica
5656
* logic will provide its own SYSLOG device initialize which must include
57-
* as a minimum a call to syslog_channel() to use the device.
57+
* as a minimum a call to syslog_channel_register() to use the device.
5858
*
5959
* Input Parameters:
6060
* None

include/nuttx/syslog/syslog.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ extern "C"
164164
****************************************************************************/
165165

166166
/****************************************************************************
167-
* Name: syslog_channel
167+
* Name: syslog_channel_register
168168
*
169169
* Description:
170170
* Configure the SYSLOGging function to use the provided channel to
@@ -179,10 +179,10 @@ extern "C"
179179
*
180180
****************************************************************************/
181181

182-
int syslog_channel(FAR struct syslog_channel_s *channel);
182+
int syslog_channel_register(FAR struct syslog_channel_s *channel);
183183

184184
/****************************************************************************
185-
* Name: syslog_channel_remove
185+
* Name: syslog_channel_unregister
186186
*
187187
* Description:
188188
* Removes an already configured SYSLOG channel from the list of used
@@ -197,7 +197,7 @@ int syslog_channel(FAR struct syslog_channel_s *channel);
197197
*
198198
****************************************************************************/
199199

200-
int syslog_channel_remove(FAR struct syslog_channel_s *channel);
200+
int syslog_channel_unregister(FAR struct syslog_channel_s *channel);
201201

202202
/****************************************************************************
203203
* Name: syslog_initialize
@@ -211,11 +211,11 @@ int syslog_channel_remove(FAR struct syslog_channel_s *channel);
211211
* This function performs these basic operations:
212212
*
213213
* - Initialize the SYSLOG device
214-
* - Call syslog_channel() to begin using that device.
214+
* - Call syslog_channel_register() to begin using that device.
215215
*
216216
* If CONFIG_ARCH_SYSLOG is selected, then the architecture-specifica
217217
* logic will provide its own SYSLOG device initialize which must include
218-
* as a minimum a call to syslog_channel() to use the device.
218+
* as a minimum a call to syslog_channel_register() to use the device.
219219
*
220220
* Input Parameters:
221221
* None
@@ -240,9 +240,10 @@ int syslog_initialize(void);
240240
* SYSLOG channel.
241241
*
242242
* This tiny function is simply a wrapper around syslog_dev_initialize()
243-
* and syslog_channel(). It calls syslog_dev_initialize() to configure
244-
* the character file at 'devpath then calls syslog_channel() to use that
245-
* device as the SYSLOG output channel.
243+
* and syslog_channel_register(). It calls syslog_dev_initialize() to
244+
* configure the character file at 'devpath then calls
245+
* syslog_channel_register() to use that device as the SYSLOG output
246+
* channel.
246247
*
247248
* File SYSLOG channels differ from other SYSLOG channels in that they
248249
* cannot be established until after fully booting and mounting the target

0 commit comments

Comments
 (0)