Changeset 275482 in webkit


Ignore:
Timestamp:
Apr 5, 2021 7:46:54 PM (3 years ago)
Author:
commit-queue@webkit.org
Message:

Document how to use logging in WebKit
https://bugs.webkit.org/show_bug.cgi?id=224152

Patch by Tyler Wilcock <Tyler Wilcock> on 2021-04-05
Reviewed by Simon Fraser.

Add documentation about how to use logging in WebKit.

  • Introduction.md:
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r275150 r275482  
     12021-04-05  Tyler Wilcock  <twilco.o@protonmail.com>
     2
     3        Document how to use logging in WebKit
     4        https://bugs.webkit.org/show_bug.cgi?id=224152
     5
     6        Reviewed by Simon Fraser.
     7
     8        Add documentation about how to use logging in WebKit.
     9
     10        * Introduction.md:
     11
    1122021-03-28  David Kilzer  <ddkilzer@apple.com>
    213
  • trunk/Introduction.md

    r273463 r275482  
    13451345# Logging in WebKit
    13461346
    1347 FIXME: Write this.
    1348 
     1347Some places in WebKit use a macro called `LOG_WITH_STREAM`. Here's an example invocation:
     1348
     1349```
     1350LOG_WITH_STREAM(Scrolling, stream << "ScrollingTree::commitTreeState - removing unvisited node " << nodeID);
     1351```
     1352
     1353The first argument is the _log channel_ and the second is the _log content_. By default, this logging is enabled in
     1354debug builds and disabled in release builds (see definition of `LOG_DISABLED`).
     1355
     1356The only logs that will be printed are those whose channels you have enabled. You can specify the channels you want to
     1357enable by constructing a comma-separated list with the following syntax:
     1358
     1359* `ChannelName` to enable logging for this channel
     1360* `all` to enable logging for all channels
     1361* `-ChannelName` to disable logging for this channel
     1362
     1363Where you specify this list depends on the platform you are running WebKit on.
     1364
     1365### Linux
     1366
     1367Set the `WEBKIT_DEBUG` environment variable.
     1368
     1369```
     1370WEBKIT_DEBUG=Scrolling Tools/Scripts/run-minibrowser --gtk --debug
     1371```
     1372
     1373### Mac
     1374
     1375Set a value for the `WebCoreLogging` key in [standardUserDefaults](https://developer.apple.com/documentation/foundation/nsuserdefaults/1416603-standarduserdefaults).
     1376
     1377You may also pass this key and value as an argument:
     1378
     1379```
     1380Tools/Scripts/run-minibrowser --debug -WebCoreLogging Scrolling
     1381```
     1382
     1383or set the key and value on the [NSGlobalDomain](https://developer.apple.com/documentation/foundation/nsglobaldomain).
     1384
     1385```
     1386defaults write NSGlobalDomain  WebCoreLogging -string Scrolling
     1387Tools/Scripts/run-minibrowser --debug
     1388```
     1389
     1390### Windows
     1391
     1392Set the `WebCoreLogging` environment variable.
Note: See TracChangeset for help on using the changeset viewer.