dxFeed Graal Native SDK 3.9.0
Loading...
Searching...
No Matches
Logging

Data Structures

struct  dxfg_logging_listener_t

Typedefs

typedef enum dxfg_logging_level_t dxfg_logging_level_t
typedef struct dxfg_logging_listener_t dxfg_logging_listener_t
typedef void(*) dxfg_logging_listener_function_t(graal_isolatethread_t *thread, dxfg_logging_level_t level, int64_t timestamp, const char *thread_name, int64_t thread_id, const char *logger_name, const char *message, dxfg_exception_t *exception, const char *formatted_message, void *user_data)
 A callback type for the logging listener.

Enumerations

enum  dxfg_logging_level_t {
  DXFG_LOGGING_LEVEL_ALL = 0 , DXFG_LOGGING_LEVEL_TRACE , DXFG_LOGGING_LEVEL_DEBUG , DXFG_LOGGING_LEVEL_INFO ,
  DXFG_LOGGING_LEVEL_WARN , DXFG_LOGGING_LEVEL_ERROR , DXFG_LOGGING_LEVEL_OFF
}

Functions

int32_t dxfg_logging_listener_new (graal_isolatethread_t *thread, dxfg_logging_listener_function_t user_func, void *user_data, DXFG_OUT dxfg_logging_listener_t **listener)
int32_t dxfg_logging_set_listener (graal_isolatethread_t *thread, dxfg_logging_listener_t *listener)
int32_t dxfg_logging_set_log_level (graal_isolatethread_t *thread, dxfg_logging_level_t level)
int32_t dxfg_logging_set_err_level (graal_isolatethread_t *thread, dxfg_logging_level_t level)

Detailed Description

Typedef Documentation

◆ dxfg_logging_level_t

Defines a set of standard logging levels that can be used to control logging output.

◆ dxfg_logging_listener_function_t

typedef void(*) dxfg_logging_listener_function_t(graal_isolatethread_t *thread, dxfg_logging_level_t level, int64_t timestamp, const char *thread_name, int64_t thread_id, const char *logger_name, const char *message, dxfg_exception_t *exception, const char *formatted_message, void *user_data)

A callback type for the logging listener.

◆ dxfg_logging_listener_t

typedef struct dxfg_logging_listener_t dxfg_logging_listener_t

A handle of a wrapper class for a listener that allows to intercept logged messages.

Enumeration Type Documentation

◆ dxfg_logging_level_t

Defines a set of standard logging levels that can be used to control logging output.

Enumerator
DXFG_LOGGING_LEVEL_ALL 

Indicates that all messages should be logged.

DXFG_LOGGING_LEVEL_TRACE 

Indicates a highly detailed tracing message.

DXFG_LOGGING_LEVEL_DEBUG 

It is a message level providing tracing debug information.

DXFG_LOGGING_LEVEL_INFO 

It is a message level for informational messages.

DXFG_LOGGING_LEVEL_WARN 

It is a message level indicating a potential problem.

DXFG_LOGGING_LEVEL_ERROR 

It is a message level indicating a serious failure.

DXFG_LOGGING_LEVEL_OFF 

It is a special level that can be used to turn off logging.

Function Documentation

◆ dxfg_logging_listener_new()

int32_t dxfg_logging_listener_new ( graal_isolatethread_t * thread,
dxfg_logging_listener_function_t user_func,
void * user_data,
DXFG_OUT dxfg_logging_listener_t ** listener )

Creates a new listener.

//
void callback(graal_isolatethread_t *thread, dxfg_logging_level_t level, int64_t timestamp, const char *thread_name,
int64_t thread_id, const char *logger_name, const char *message, dxfg_exception_t *exception,
const char *formatted_message, void *user_data) {
printf("[%" PRId64 "]: %s", thread_id, formatted_message);
}
// ...
// Set the logging Java class
dxfg_system_set_property(isolate_thread, "log.className", "com.devexperts.logging.InterceptableLogging");
// Turn off logging.
dxfg_system_set_property(isolate_thread, "log.level", "OFF");
dxfg_logging_listener_t *listener = {};
dxfg_logging_listener_new(isolate_thread, &callback, NULL, &listener);
dxfg_logging_set_listener(isolate_thread, listener);
// Turn on logging
dxfg_DXEndpoint_close(isolate_thread, ep);
dxfg_JavaObjectHandler_release(isolate_thread, &listener->handler);
struct __graal_isolatethread_t graal_isolatethread_t
Definition graal_isolate.h:59
int32_t dxfg_DXEndpoint_close(graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
dxfg_endpoint_t * dxfg_DXEndpoint_getInstance(graal_isolatethread_t *thread)
int32_t dxfg_JavaObjectHandler_release(graal_isolatethread_t *thread, dxfg_java_object_handler *handler)
int32_t dxfg_logging_set_log_level(graal_isolatethread_t *thread, dxfg_logging_level_t level)
int32_t dxfg_logging_listener_new(graal_isolatethread_t *thread, dxfg_logging_listener_function_t user_func, void *user_data, DXFG_OUT dxfg_logging_listener_t **listener)
int32_t dxfg_logging_set_listener(graal_isolatethread_t *thread, dxfg_logging_listener_t *listener)
dxfg_logging_level_t
Definition dxfg_logging.h:32
@ DXFG_LOGGING_LEVEL_INFO
It is a message level for informational messages.
Definition dxfg_logging.h:43
int32_t dxfg_system_set_property(graal_isolatethread_t *thread, const char *key, const char *value)
Sets the system property indicated by the specified key.
The DXEndpoint. Javadoc.
Definition dxfg_endpoint.h:39
dxfg_java_object_handler handler
Definition dxfg_endpoint.h:40
The Exception. Javadoc.
Definition dxfg_catch_exception.h:44
Definition dxfg_logging.h:58
dxfg_java_object_handler handler
Definition dxfg_logging.h:59
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]user_funcThe listener callback.
[in]user_dataThe user data that will be passed to the callback.
[out]listenerThe new listener.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the listener handle.

◆ dxfg_logging_set_err_level()

int32_t dxfg_logging_set_err_level ( graal_isolatethread_t * thread,
dxfg_logging_level_t level )

Sets the logging level for the err file.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]levelThe new logging level.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_logging_set_listener()

int32_t dxfg_logging_set_listener ( graal_isolatethread_t * thread,
dxfg_logging_listener_t * listener )

Sets the logging listener. This function will toggle logging. Messages will not be logged to console and files.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]listenerThe logging listener.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_logging_set_log_level()

int32_t dxfg_logging_set_log_level ( graal_isolatethread_t * thread,
dxfg_logging_level_t level )

Sets the logging level for the listener or console or log file.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]levelThe new logging level.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.