mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-25 20:42:55 +00:00
When launched with the new --enable-idl-tracing option, we now log every call to web platform APIs declared via IDL, along with the arguments passed. This can be very helpful when trying to figure out what a site is doing, especially if it's not doing what you'd expect.
22 lines
392 B
C++
22 lines
392 B
C++
/*
|
|
* Copyright (c) 2024, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibJS/Forward.h>
|
|
|
|
namespace Web::WebIDL {
|
|
|
|
extern bool g_enable_idl_tracing;
|
|
|
|
inline void log_trace(JS::VM& vm, char const* function)
|
|
{
|
|
void log_trace_impl(JS::VM&, char const*);
|
|
if (g_enable_idl_tracing)
|
|
log_trace_impl(vm, function);
|
|
}
|
|
|
|
}
|