andrewvy/chrome-remote-interface

Log usage of deprecated APIs

Opened this issue · 1 comments

If usage of a deprecated API function call is detected, we should log out the deprecation message:

{
    "name": "addScriptToEvaluateOnLoad",
    "parameters": [
        {
            "name": "scriptSource",
            "type": "string"
        }
    ],
    "returns": [
        {
            "name": "identifier",
            "$ref": "ScriptIdentifier",
            "description": "Identifier of the added script."
        }
    ],
    "deprecated": true,
    "description": "Deprecated, please use addScriptToEvaluateOnNewDocument instead.",
    "experimental": true
}

Here, we can parse out the deprecated boolean attribute and log out the description.

It would be great if the generated code was smart enough to conditionally log if the command had a deprecation. In other words, unnecessary bytes shouldn't be present in generated functions for commands that don't have deprecations.