当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Logger.debug方法代码示例

本文整理汇总了TypeScript中@src/lib/logging.Logger.debug方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Logger.debug方法的具体用法?TypeScript Logger.debug怎么用?TypeScript Logger.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@src/lib/logging.Logger的用法示例。


在下文中一共展示了Logger.debug方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: create

export async function create(
    name: string,
    color = "random",
    icon = "fingerprint",
): Promise<string> {
    if (color === "random") color = chooseRandomColor()
    const container = fromString(name, color, icon)
    // browser.contextualIdentities.create does not accept a cookieStoreId property.
    delete container.cookieStoreId
    logger.debug(container)

    if (await exists(name)) {
        logger.debug(`[Container.create] container already exists ${container}`)
        throw new Error(
            `[Container.create] container already exists, aborting.`,
        )
    } else {
        const res = await browser.contextualIdentities.create(container)
        return res.cookieStoreId
    }
}
开发者ID:antonva,项目名称:tridactyl,代码行数:21,代码来源:containers.ts

示例2: addContentStateChangedListener

    addContentStateChangedListener((property, oldMode, oldValue, newValue) => {
        let mode = newValue
        let suffix = ""
        let result = ""
        if (property !== "mode") {
            if (property === "suffix") {
                mode = oldMode
                suffix = newValue
            } else {
                return
            }
        }

        const privateMode = browser.extension.inIncognitoContext
            ? "TridactylPrivate"
            : ""
        statusIndicator.className =
            "cleanslate TridactylStatusIndicator " + privateMode
        if (
            dom.isTextEditable(document.activeElement) &&
            !["input", "ignore"].includes(mode)
        ) {
            statusIndicator.textContent = "insert"
            // this doesn't work; statusIndicator.style is full of empty string
            // statusIndicator.style.borderColor = "green !important"
            // need to fix loss of focus by click: doesn't do anything here.
        } else if (
            mode === "insert" &&
            !dom.isTextEditable(document.activeElement)
        ) {
            statusIndicator.textContent = "normal"
            // statusIndicator.style.borderColor = "lightgray !important"
        } else {
            result = mode
        }
        const modeindicatorshowkeys = Config.get("modeindicatorshowkeys")
        if (modeindicatorshowkeys === "true" && suffix !== "") {
            result = mode + " " + suffix
        }
        logger.debug(
            "statusindicator: ",
            result,
            ";",
            "config",
            modeindicatorshowkeys,
        )
        statusIndicator.textContent = result
        statusIndicator.className +=
            " TridactylMode" + statusIndicator.textContent

        if (config.get("modeindicator") !== "true") statusIndicator.remove()
    })
开发者ID:antonva,项目名称:tridactyl,代码行数:52,代码来源:content.ts

示例3: update

export async function update(
    containerId: string,
    updateObj: {
        name: string
        color: browser.contextualIdentities.IdentityColor
        icon: browser.contextualIdentities.IdentityIcon
    },
) {
    if (isValidColor(updateObj.color) && isValidIcon(updateObj.icon)) {
        browser.contextualIdentities.update(containerId, updateObj)
    } else {
        logger.debug(updateObj)
        throw new Error("[Container.update] invalid container icon or color")
    }
}
开发者ID:antonva,项目名称:tridactyl,代码行数:15,代码来源:containers.ts

示例4: updateVersion

async function updateVersion() {
    try {
        // If any monster any makes a novelty tag this will break.
        // So let's just ignore any errors.
        const parser = new RssParser()
        const feed = await parser.parseURL("https://github.com/tridactyl/tridactyl/tags.atom")
        const mostRecent = feed.items[0]

        // Update our last update check timestamp and the version itself.
        Config.set("update", "lastchecktime", Date.now())
        highestKnownVersion = {
            version: mostRecent.title,
            releaseDate: new Date(mostRecent.pubDate), // e.g. 2018-12-04T15:24:43.000Z
        }
        logger.debug("Checked for new version of Tridactyl, found ", highestKnownVersion)
    } catch (e) {
        logger.error("Error while checking for updates: ", e)
    }
}
开发者ID:antonva,项目名称:tridactyl,代码行数:19,代码来源:updates.ts

示例5: remove

export async function remove(name: string) {
    logger.debug(name)
    const id = await getId(name)
    const res = await browser.contextualIdentities.remove(id)
    logger.debug("[Container.remove] removed container:", res.cookieStoreId)
}
开发者ID:antonva,项目名称:tridactyl,代码行数:6,代码来源:containers.ts

示例6:

 .catch(error => {
     logger.debug(error)
 })
开发者ID:antonva,项目名称:tridactyl,代码行数:3,代码来源:content.ts

示例7: Error

if ((window as any).tridactyl_content_lock !== undefined) {
    throw Error("Trying to load Tridactyl, but it's already loaded.")
}
(window as any).tridactyl_content_lock = "locked"

// Be careful: typescript elides imports that appear not to be used if they're
// assigned to a name.  If you want an import just for its side effects, make
// sure you import it like this:
import "@src/lib/html-tagged-template"
/* import "@src/content/commandline_content" */
/* import "@src/excmds_content" */
/* import "@src/content/hinting" */
import * as Config from "@src/lib/config"
import * as Logging from "@src/lib/logging"
const logger = new Logging.Logger("content")
logger.debug("Tridactyl content script loaded, boss!")

// Our local state
import {
    contentState,
    addContentStateChangedListener,
} from "@src/content/state_content"

// Set up our controller to execute content-mode excmds. All code
// running from this entry point, which is to say, everything in the
// content script, will use the excmds that we give to the module
// here.
import * as controller from "@src/lib/controller"
import * as excmds_content from "@src/.excmds_content.generated"
import { CmdlineCmds } from "@src/content/commandline_cmds"
import { EditorCmds } from "@src/content/editor"
开发者ID:antonva,项目名称:tridactyl,代码行数:31,代码来源:content.ts


注:本文中的@src/lib/logging.Logger.debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。