Warning and debug in Gnome technology
2015-03-25 19:17
295 查看
</pre><h3 style="">g_warning()</h3><pre class="programlisting" style="">#define g_warning(...)
A convenience function/macro to log a warning message.
You can make warnings fatal at runtime by setting the
G_DEBUGenvironment variable (see Running
GLib Applications).
If
g_log_default_handler()is
used as the log handler function, a newline character will automatically be appended to @..., and need not be entered manually.
Parameters
... | format string, followed by parameters to insert into the format string (as with printf()) |
g_warning ("Error doing something blah: %s", g_strerror (-r));
Debug and critical are almost the same as the warning.
Here are the API of g_debug and g_critical.
g_debug()
#define g_debug(...)
A convenience function/macro to log a debug message.
If
g_log_default_handler()is
used as the log handler function, a new-line character will automatically be appended to @..., and need not be entered manually.
Such messages are suppressed by the
g_log_default_handler()unless
the G_MESSAGES_DEBUG environment variable is set appropriately.
Parameters
... | format string, followed by parameters to insert into the format string (as with printf()) |
g_critical()
#define g_critical(...)
Logs a "critical warning" (G_LOG_LEVEL_CRITICAL). It's more or less application-defined
what constitutes a critical vs. a regular warning. You could call
g_log_set_always_fatal()to
make critical warnings exit the program, then use
g_critical()for
fatal errors, for example.
You can also make critical warnings fatal at runtime by setting the
G_DEBUGenvironment variable (see Running
GLib Applications).
If
g_log_default_handler()is
used as the log handler function, a new-line character will automatically be appended to @..., and need not be entered manually.
Parameters
... | format string, followed by parameters to insert into the format string (as with printf()) |
相关文章推荐
- Warning and debug in Gnome technology
- Warning: Attempt to present ControllerA and ControllerB whose view is not in the window hierarchy!
- Debug messages and debug zones in Windows CE (Windows CE Base Team Blog)
- How to compile and debug VLC player source code in eclipse IDE on Ubuntu 10.04 (lucid)
- django Warning: (3135, "'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes
- How to Copy and Paste in the Ubuntu Gnome Terminal
- Switch Between Gnome And KDE Desktops In Ubuntu Or Kubuntu
- Warning 1 Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a fu
- 12 most desirable skills in all of IT and all of information technology!
- Trace and Debug in .net
- Debug messages and debug zones in Windows CE
- debug in proxy and some net interface
- [Warning] '--default-character-set' is deprecated and will be removed in a future release
- 无插件使用Eclipse和Resin调试WEB应用(Debug Web App In Eclipse and Resin Without Plugin)
- How to Enable and Run a Payables Concurrent Program in Debug Mode
- How to collect TrustZone debug logs and check the meaning of error code in the logs
- How to Copy and Paste in the Ubuntu Gnome Terminal
- Warning 1 Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a fu
- Satellite Imagery and GIS Technology Improve Wildlife Conservation in Virunga National Parks, Africa
- Internship in Citigroup Software Technology and Services(CSTS)(2)---A Busy and Tired Weekend