libgxim Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
GXimMessages; struct GXimMessagesClass; enum GXimMessagesType; #define LIBGXIM_INTERFACE_DBUS #define LIBGXIM_PATH_DBUS #define LIBGXIM_SERVICE_DBUS #define g_xim_message (_i_, _f_, ...) void g_xim_messages_activate (GXimMessages *message
,gboolean flag
); #define g_xim_messages_bug (_i_, ...) void g_xim_messages_clear_filter (GXimMessages *message
); #define g_xim_messages_critical (_i_, ...) #define g_xim_messages_debug (_i_, _f_, ...) void g_xim_messages_enable_filter (GXimMessages *message
,const gchar *filter_name
); #define g_xim_messages_error (_i_, ...) #define g_xim_messages_gerror (_i_, _e_) #define g_xim_messages_info (_i_, _f_, ...) GXimMessages * g_xim_messages_new (void
); void g_xim_messages_printf (GXimMessages *message
,const gchar *filter
,GXimMessagesType type
,const gchar *format
,...
); void g_xim_messages_set_filename (GXimMessages *message
,const gchar *filename
); void g_xim_messages_vprintf (GXimMessages *message
,const gchar *filter
,GXimMessagesType type
,const gchar *format
,va_list args
); #define g_xim_messages_warning (_i_, ...)
"activated" :Run Last
"created" :Run First
"filename-changed" :Run Last
"filter-added" :Run Last
"filter-cleared" :Run Last
GXimMessages provides a logging facility. this allows you to output messages any time you want. you can manage it with DBus as well. so you don't even restart processes to do something with this then.
Right now the following signals are available to manage the logging facility. you can emits signals any time as following:
1 |
$ dbus-send --session --type=signal /org/tagoh/libgxim org.tagoh.libgxim.<em class="replaceable"><code>SignalName</code></em> type:<em class="replaceable"><code>value</code></em> |
SignalName
will be replaced with following signal names. See manpage for
dbus-send to learn usage for others.
Activate |
Sets the activity of the logging facility. a boolean value is required
as a parameter. See |
SetFilename |
Sets the filename to be logged messages into. a string value is required
as a parameter. See |
RemoveAllFilters |
Resets filters to output. See |
AddFilter |
Adds a filter which you want to see a message. a string value is required
as a parameter. See |
typedef enum { G_XIM_MESSAGES_MESSAGE, G_XIM_MESSAGES_DEBUG, G_XIM_MESSAGES_INFO, G_XIM_MESSAGES_WARNING, G_XIM_MESSAGES_ERROR, G_XIM_MESSAGES_CRITICAL, G_XIM_MESSAGES_BUG } GXimMessagesType;
Flags specifying the type of messages.
a message type for usual messages, see g_xim_message() .
|
|
a message type for debug, see g_xim_messages_debug() .
|
|
a message type for information, see g_xim_messages_info() .
|
|
a message type for warnings, see g_xim_messages_warning() .
|
|
a message type for errors, see g_xim_messages_error() .
|
|
a message type for critical errors, see g_xim_messages_critical() .
|
|
a message type for bugs, see g_xim_messages_bug() .
|
#define LIBGXIM_INTERFACE_DBUS "org.tagoh.libgxim"
An interface name for libgxim used in DBus.
#define LIBGXIM_PATH_DBUS "/org/tagoh/libgxim"
A path name for libgxim used in DBus.
#define LIBGXIM_SERVICE_DBUS "org.tagoh.libgxim"
A service name for libgxim used in DBus.
#define g_xim_message(_i_,_f_,...)
Outputs a message with g_xim_messages_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGES_MESSAGE
.
|
a GXimMessages. |
|
a unique filter name. |
|
arguments include the format string |
void g_xim_messages_activate (GXimMessages *message
,gboolean flag
);
Sets the activity of the logging facility.
This affects all of the instance of GXimMessages in the process.
|
a GXimMessages. |
|
TRUE to enable logging. FALSE to disable logging. |
#define g_xim_messages_bug(_i_,...)
Outputs a message with g_xim_messages_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGES_BUG
.
|
a GXimMessages. |
|
arguments include the format string. |
void g_xim_messages_clear_filter (GXimMessages *message
);
Resets all of the filters you wanted to allow a message.
This affects all of the instance of GXimMessages in the process.
|
a GXimMessages. |
#define g_xim_messages_critical(_i_,...)
Outputs a message with g_xim_messages_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGES_CRITICAL
.
|
a GXimMessages. |
|
arguments include the format string. |
#define g_xim_messages_debug(_i_,_f_,...)
Outputs a message with g_xim_messages_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGES_DEBUG
.
|
a GXimMessages. |
|
a unique filter name. |
|
arguments include the format string. |
void g_xim_messages_enable_filter (GXimMessages *message
,const gchar *filter_name
);
Allows logging a message categorized to filter_name
. "all" and "noall"
filter name is reserved. "all" to enable all of filters no matter what
filters are enabled. "noall" to enable filters specified by this function.
This affects all of the instance of GXimMessages in the process.
|
a GXimMessages. |
|
a unique filter name to be categorized. |
#define g_xim_messages_error(_i_,...)
Outputs a message with g_xim_messages_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGES_ERROR
.
|
a GXimMessages. |
|
arguments include the format string. |
#define g_xim_messages_gerror(_i_,_e_)
Outputs a GError with g_xim_messages_printf()
.
This is a convenience macro to output a message. the message type depends on the error code which would be logically added with GXimErrorType.
|
a GXimMessages. |
|
a GError to output. |
#define g_xim_messages_info(_i_,_f_,...)
Outputs a message with g_xim_messages_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGES_INFO
.
|
a GXimMessages. |
|
a unique filter name. |
|
arguments include the format string. |
GXimMessages * g_xim_messages_new (void
);
Creates an instance to provide you a logging facility. when an instance is created, GXimMessages::created signal will be emitted.
Returns : |
a GXimMessages. |
void g_xim_messages_printf (GXimMessages *message
,const gchar *filter
,GXimMessagesType type
,const gchar *format
,...
);
Outputs a message. when G_XIM_MESSAGES_WARNING
, G_XIM_MESSAGES_ERROR
,
G_XIM_MESSAGES_CRITICAL
or G_XIM_MESSAGES_BUG
is specified to type
,
a message will be output regardless of what filter is given to filter
.
Otherwise if filter
isn't enabled, this just will be ignored.
|
a GXimMessages. |
|
a unique filter name to be categorized. |
|
an urgency of the message. |
|
the message format. See the printf() documentation. |
|
arguments to format . |
void g_xim_messages_set_filename (GXimMessages *message
,const gchar *filename
);
Sets the filename.
This affects all of the instance of GXimMessages in the process.
|
a GXimMessages. |
|
the filename to be logged a message into. |
void g_xim_messages_vprintf (GXimMessages *message
,const gchar *filter
,GXimMessagesType type
,const gchar *format
,va_list args
);
Outputs a message. when G_XIM_MESSAGES_WARNING
, G_XIM_MESSAGES_ERROR
,
G_XIM_MESSAGES_CRITICAL
or G_XIM_MESSAGES_BUG
is specified to type
,
a message will be output regardless of what filter is given to filter
.
Otherwise if filter
isn't enabled, this just will be ignored.
|
a GXimMessages. |
|
a unique filter name to be categorized. |
|
an urgency of the message. |
|
the message format. See the printf() documentation. |
|
a va_list. |
#define g_xim_messages_warning(_i_,...)
Outputs a message with g_xim_messages_printf()
.
This is a convenience macro to output a message with G_XIM_MESSAGES_WARNING
.
|
a GXimMessages. |
|
arguments include the format string. |
"all-filters"
property "all-filters" gboolean : Read / Write
TRUE
to enable all of the messages filters. FALSE
to deal with each filters added by "filter-added" signal.
Default value: FALSE
"master"
property "master" gboolean : Read / Write
TRUE
to be a master instance of GXimMessages. FALSE
to be a slave instance of GXimMessages.
Default value: FALSE
"activated"
signalgboolean user_function (GXimMessages *message,
gboolean flag,
gpointer user_data) : Run Last
The ::activated signal will be emitted when someone calls
g_xim_messages_activate()
or when someone emits Activate signal
through DBus.
|
the object which received the signal. |
|
TRUE to enable the logging facility. |
|
user data set when the signal handler was connected. |
Returns : |
TRUE to stop other handlers from being invoked for
the event. FALSE to propagate the event further. |
"created"
signalvoid user_function (GXimMessages *message,
GXimMessages *created_object,
gpointer user_data) : Run First
The ::created signal will be emitted when an instance of GXimMessages is created. the master object only receives this signal.
|
the object which received the signal. |
|
a GXimMessages which newly created somewhere in the process. |
|
user data set when the signal handler was connected. |
"filename-changed"
signalgboolean user_function (GXimMessages *message,
gchar *filename,
gpointer user_data) : Run Last
The ::filename-changed signal will be emitted when someone calls
g_xim_messages_set_filename()
or when someone emits SetFilename signal
through DBus.
|
the object which received the signal. |
|
a filename to be logged into. |
|
user data set when the signal handler was connected. |
Returns : |
TRUE to stop other handlers from being invoked for
the event. FALSE to propagate the event further. |
"filter-added"
signalgboolean user_function (GXimMessages *message,
gchar *filter,
gpointer user_data) : Run Last
The ::filter-added signal will be emitted when someone calls
g_xim_messages_enable_filter()
or when someone emits AddFilter signal
through DBus.
|
the object which received the signal. |
|
the filter name to enable logging. |
|
user data set when the signal handler was connected. |
Returns : |
TRUE to stop other handlers from being invoked for
the event. FALSE to propagate the event further. |
"filter-cleared"
signalgboolean user_function (GXimMessages *message,
gpointer user_data) : Run Last
The ::filter-cleared signal will be emitted when someone calls
g_xim_messages_clear_filter()
or when someone emits RemoveAllFilters
signal through DBus.
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
Returns : |
TRUE to stop other handlers from being invoked for
the event. FALSE to propagate the event further. |