mirror of
https://github.com/status-im/react-native.git
synced 2025-01-28 18:25:06 +00:00
27f504e9e3
Summary: Adds the Console agent which we hook from our console polyfill. It captures the stack and strips the frames of the polyfill. Reviewed By: davidaurelio Differential Revision: D4021502 fbshipit-source-id: 49cb700a139270485b7595e85e52d50c9a620db6
40 lines
879 B
C++
40 lines
879 B
C++
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Agent.h"
|
|
|
|
namespace JSC {
|
|
class JSGlobalObject;
|
|
class ExecState;
|
|
class JSArray;
|
|
}
|
|
|
|
namespace Inspector {
|
|
class InjectedScriptManager;
|
|
}
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
class ConsoleAgent : public Agent {
|
|
public:
|
|
ConsoleAgent(JSC::JSGlobalObject& globalObject, Inspector::InjectedScriptManager* injectedScriptManager);
|
|
|
|
void log(JSC::ExecState* execState, std::string message);
|
|
void log(JSC::ExecState* execState, std::string level, std::string message, JSC::JSArray* params, size_t framesToSkip);
|
|
private:
|
|
bool enabled_{false};
|
|
JSC::JSGlobalObject& globalObject_;
|
|
Inspector::InjectedScriptManager* injectedScriptManager_;
|
|
|
|
folly::dynamic convertParams(JSC::ExecState* execState, JSC::JSArray* params);
|
|
|
|
std::string getDomain() override {
|
|
return "Console";
|
|
}
|
|
};
|
|
|
|
}
|
|
}
|