logFd_interface.h

Go to the documentation of this file.
1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_logFd File Descriptor Logging API
14  *
15  * @ref logFd_interface.h "API Reference"
16  *
17  * This API provides a method for logging messages coming from a file descriptor such as a pipe or
18  * socket. This API MUST only be used by the Supervisor.
19  *
20  * <HR>
21  *
22  * Copyright (C) Sierra Wireless Inc.
23  */
24 /**
25  * @file logFd_interface.h
26  *
27  * Legato @ref c_logFd include file.
28  *
29  * Copyright (C) Sierra Wireless Inc.
30  */
31 
32 #ifndef LOGFD_INTERFACE_H_INCLUDE_GUARD
33 #define LOGFD_INTERFACE_H_INCLUDE_GUARD
34 
35 
36 #include "legato.h"
37 
38 // Interface specific includes
39 #include "le_limit_interface.h"
40 
41 
42 //--------------------------------------------------------------------------------------------------
43 /**
44  * Type for handler called when a server disconnects.
45  */
46 //--------------------------------------------------------------------------------------------------
47 typedef void (*logFd_DisconnectHandler_t)(void *);
48 
49 //--------------------------------------------------------------------------------------------------
50 /**
51  *
52  * Connect the current client thread to the service providing this API. Block until the service is
53  * available.
54  *
55  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
56  * called before any other functions in this API. Normally, ConnectService is automatically called
57  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
58  *
59  * This function is created automatically.
60  */
61 //--------------------------------------------------------------------------------------------------
63 (
64  void
65 );
66 
67 //--------------------------------------------------------------------------------------------------
68 /**
69  *
70  * Try to connect the current client thread to the service providing this API. Return with an error
71  * if the service is not available.
72  *
73  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
74  * called before any other functions in this API. Normally, ConnectService is automatically called
75  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
76  *
77  * This function is created automatically.
78  *
79  * @return
80  * - LE_OK if the client connected successfully to the service.
81  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
82  * bound.
83  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
84  * - LE_COMM_ERROR if the Service Directory cannot be reached.
85  */
86 //--------------------------------------------------------------------------------------------------
88 (
89  void
90 );
91 
92 //--------------------------------------------------------------------------------------------------
93 /**
94  * Set handler called when server disconnection is detected.
95  *
96  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
97  * to continue without exiting, it should call longjmp() from inside the handler.
98  */
99 //--------------------------------------------------------------------------------------------------
101 (
102  logFd_DisconnectHandler_t disconnectHandler,
103  void *contextPtr
104 );
105 
106 //--------------------------------------------------------------------------------------------------
107 /**
108  *
109  * Disconnect the current client thread from the service providing this API.
110  *
111  * Normally, this function doesn't need to be called. After this function is called, there's no
112  * longer a connection to the service, and the functions in this API can't be used. For details, see
113  * @ref apiFilesC_client.
114  *
115  * This function is created automatically.
116  */
117 //--------------------------------------------------------------------------------------------------
119 (
120  void
121 );
122 
123 
124 //--------------------------------------------------------------------------------------------------
125 /**
126  * Registers an application process' standard error for logging. Messages from this file descriptor
127  * will be logged at LE_LOG_ERR level.
128  *
129  * @return
130  * LE_OK if successful.
131  * LE_FAULT if there was an error.
132  */
133 //--------------------------------------------------------------------------------------------------
134 void logFd_StdErr
135 (
136  int fd,
137  ///< [IN] stderr file descriptor.
138  const char* LE_NONNULL appName,
139  ///< [IN] Name of the application.
140  const char* LE_NONNULL procName,
141  ///< [IN] Name of the process.
142  int32_t pid
143  ///< [IN] PID of the process.
144 );
145 
146 //--------------------------------------------------------------------------------------------------
147 /**
148  * Registers an application process' standard out for logging. Messages from this file descriptor
149  * will be logged at LE_LOG_INFO level.
150  *
151  * @return
152  * LE_OK if successful.
153  * LE_FAULT if there was an error.
154  */
155 //--------------------------------------------------------------------------------------------------
156 void logFd_StdOut
157 (
158  int fd,
159  ///< [IN] stdout file descriptor.
160  const char* LE_NONNULL appName,
161  ///< [IN] Name of the application.
162  const char* LE_NONNULL procName,
163  ///< [IN] Name of the process.
164  int32_t pid
165  ///< [IN] PID of the process.
166 );
167 
168 #endif // LOGFD_INTERFACE_H_INCLUDE_GUARD
void logFd_ConnectService(void)
le_result_t
Definition: le_basics.h:35
le_result_t logFd_TryConnectService(void)
void(* logFd_DisconnectHandler_t)(void *)
Definition: logFd_interface.h:47
void logFd_SetServerDisconnectHandler(logFd_DisconnectHandler_t disconnectHandler, void *contextPtr)
void logFd_StdErr(int fd, const char *LE_NONNULL appName, const char *LE_NONNULL procName, int32_t pid)
void logFd_StdOut(int fd, const char *LE_NONNULL appName, const char *LE_NONNULL procName, int32_t pid)
void logFd_DisconnectService(void)