EPICS Base  7.0.8.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Typedefs | Functions
logClient.h File Reference

Client on the IOC that forwards log messages to the log server. More...

#include "libComAPI.h"
#include "osiSock.h"
#include "iocLog.h"
Include dependency graph for logClient.h:

Go to the source code of this file.

Typedefs

typedef void * logClientId
 Abstract type that represents handle to the log client.
 

Functions

LIBCOM_API logClientId epicsStdCall logClientCreate (struct in_addr server_addr, unsigned short server_port)
 Creates a new log client. More...
 
LIBCOM_API void epicsStdCall logClientSend (logClientId id, const char *message)
 Log message. More...
 
LIBCOM_API void epicsStdCall logClientShow (logClientId id, unsigned level)
 Prints debug information about the log client state. More...
 
LIBCOM_API void epicsStdCall logClientFlush (logClientId id)
 Flushes all outstanding messages. More...
 
LIBCOM_API void epicsStdCall iocLogPrefix (const char *prefix)
 Set prefix to be sent infront of every log message. More...
 
LIBCOM_API logClientId epicsStdCall logClientInit (void)
 DEPRECATED. More...
 

Detailed Description

Together with the program iocLogServer, a log client provides generic support for logging text messages from an IOC or other program to the log server host machine.

Definition in file logClient.h.

Function Documentation

LIBCOM_API logClientId epicsStdCall logClientCreate ( struct in_addr  server_addr,
unsigned short  server_port 
)

Starts a background thread to connect to server and returns immediately. If a connection cannot be established, an error message is printed on the console, but the log client will keep trying to connect in the background. This thread will also periodically (every 5 seconds) flush pending messages out to the server.

Parameters
server_addrlog server IP address
server_portlog server port
Returns
log client handle.
LIBCOM_API void epicsStdCall logClientSend ( logClientId  id,
const char *  message 
)

Logs message to log server. Messages are not immediately sent to the log server. Instead they are sent periodically (every 5 seconds), when the cache overflows, or when logClientFlush() is called. If messages can't sent, an error message will be printed to stderr

Parameters
idlog client handle
messagelog message
LIBCOM_API void epicsStdCall logClientShow ( logClientId  id,
unsigned  level 
)

Print information about the log client's internal state such as, connection status and cache state, to stdout

Parameters
idlog client handle
levelverbosity level. Level range is from 0 to 2
LIBCOM_API void epicsStdCall logClientFlush ( logClientId  id)

Immediately sends all outstanding messages to the server

Parameters
idlog client handle
LIBCOM_API void epicsStdCall iocLogPrefix ( const char *  prefix)

Sets a prefix to prepend every log message. Can only be set once. If already set, this function call will be ignored

Parameters
prefixthe prefix
LIBCOM_API logClientId epicsStdCall logClientInit ( void  )
Deprecated:
deprecated interface; retained for backward compatibility