| 21 | }}} |
| 22 | |
| 23 | == Logging support == |
| 24 | |
| 25 | Logging and other output/behaviors support is activated by default in a ''Debug'' build only. |
| 26 | |
| 27 | In addition to having the logging support activated in the compilation, we need also to turn on the proper logging channels when running. |
| 28 | |
| 29 | These channels are defined in the ''Logging.h'' headers along the code: |
| 30 | * [http://trac.webkit.org/browser/trunk/Source/WebCore/platform/Logging.h Source/WebCore/platform/Logging.h] |
| 31 | * [http://trac.webkit.org/browser/trunk/Source/WebKit2/Platform/Logging.h Source/WebKit2/Platform/Logging.h] |
| 32 | |
| 33 | For passing the wanted channels to the running process we need to use the ''WEBKIT_DEBUG'' env variable as it is seen in: |
| 34 | * [http://trac.webkit.org/browser/trunk/Source/WebCore/platform/gtk/LoggingGtk.cpp WebCore/platform/gtk/LoggingGtk.cpp] |
| 35 | * [http://trac.webkit.org/browser/trunk/Source/WebKit2/Platform/gtk/LoggingGtk.cpp Source/WebKit2/Platform/gtk/LoggingGtk.cpp] |
| 36 | * Notice also the ''DISABLE_NI_WARNING'' env variable referred there. |
| 37 | |
| 38 | It is important to export the ''WEBKIT_DEBUG'' env variable so we will want it also to affect the ''WeProcess''. |
| 39 | * This is an example for turning on the logging int he ''Network'' channel. Notice that the channels are case insensitive. |
| 40 | {{{ |
| 41 | #!sh |
| 42 | $ export WEBKIT_DEBUG="network" |
| 43 | $ Tools/Scripts/run-minibrowser --gtk |
| 44 | }}} |
| 45 | |
| 46 | It is also possible to turn '''on''' the logging and other output/behaviors support in a ''Release'' build by setting the proper C Macros. You may want to check the [http://trac.webkit.org/browser/trunk/Source/WTF/wtf/Assertions.h Source/WTF/wtf/Assertions.h] header. |
| 47 | * This is a ''Release'' build example in which we want to turn on the logging support |
| 48 | {{{ |
| 49 | #!sh |
| 50 | $ export CPPFLAGS="-DLOG_DISABLED=0" |
| 51 | $ Tools/Scripts/build-webkit --gtk |