Logger
Playwright generates a lot of logs and they are accessible via the pluggable logger sink.
const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.
(async () => {
const browser = await chromium.launch({
logger: {
isEnabled: (name, severity) => name === 'api',
log: (name, severity, message, args) => console.log(`${name} ${message}`)
}
});
// ...
})();
Methods
isEnabled
Added before v1.9Determines whether sink is interested in the logger with the given name and severity.
Usage
logger.isEnabled(name, severity);
Arguments
Returns
log
Added before v1.9Usage
logger.log(name, severity, message, args, hints);
Arguments