黑鸟记录器 - 绝对什么都没有发生

Blackbird logger - absolutely nothing happens

本文关键字:什么 记录器 黑鸟      更新时间:2023-09-26

这应该很简单...

我认为尝试黑鸟记录器(黑鸟主页)会很好

按照作者页面上的指南,我在服务器上创建了一个目录,并将黑鸟.js,黑鸟.css,两个黑鸟图像文件和一个包含以下内容的.html文件加载到目录中。 当我访问该页面时,警报会触发,但绝对不会发生任何其他事情。 黑鸟.js和.css文件正在加载并在调试器中可见。我哪里做错了? (在Firefox,Chrome和IE上的结果相同)。

<!DOCTYPE html>
<html lang="en-US">
<head>
    <title>Blackbird test</title>
    <link rel="Stylesheet" type="text/css" href="blackbird.css" />
    <script type="text/javascript" src="blackbird.js"></script>
    <script type="text/javascript">
        function func1() {
            alert("In function, about to send log messages");
            log.debug("hello");
            log.debug( 'this is a debug message' );
            log.info( 'this is an info message' );
            log.warn( 'this is a warning message' );
            log.error( 'this is an error message' );
        }
    </script>
</head>
<body>
<input type="button" value="click me" onclick="func1();"/>
</body>
</html>

问题是你需要明确地告诉黑鸟出现:

function func1() {
    log.toggle(); // Show it
    // rest of your code here;
}