Warning and debug in Gnome technology
2015-05-05 00:00
411 查看
</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
- Internship in Citigroup Software Technology and Services(CSTS)(1)---A Fresh Begining
- nginx error.log 提示 [error] 887#887: *58 FastCGI sent in stderr: "PHP message: PHP Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50556 Library:50637
- STM32F4 Discovery and printf() redirection to debug viewer in Keil MDK-ARM
- Using gdbserver and arm-eabi-gdb to debug native code in Android
- Switch Between Gnome And KDE Desktops In Ubuntu Or Kubuntu
- 12 most desirable skills in all of IT and all of information technology!
- UndefinedMetricWarning: Precision is ill-defined and being set to 0.0 in labels with no predicted sa
- (转)Understanding Memory in Deep Learning Systems: The Neuroscience, Psychology and Technology Perspectives
- Warning message in work center (" Factory calender and shift model have different working days".)
- 无插件使用Eclipse和Resin调试WEB应用(Debug Web App In Eclipse and Resin Without Plugin)
- Debug messages and debug zones in Windows CE (Windows CE Base Team Blog)
- 使用CodeWarrior编译时出现Warning:C12056 SP debug info incorrect because of optimization or inline assembler
- Warning 1 Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a fu
- UserWarning: The installed version of numexpr 2.4 is not supported in pandas and will be not be used
- Coping With Labor Scarcity in Information Technology: Strategies and Practices for Effective Recruit
- 禁止requests请求https的提示InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more
- Warning: Attempt to present ControllerA and ControllerB whose view is not in the window hierarchy!
- Trace and Debug in .net
- Using SHOW PROCESSLIST and mysqladmin debug Output in Conjunction with SHOW INNODB STATUS