stritti / log4js

Log4js - The Logging Framework for JavaScript with no runtime dependencies
https://stritti.github.io/log4js/
Apache License 2.0
449 stars 57 forks source link

"ConsoleAppender" is undefined #29

Closed ltdeta closed 6 years ago

ltdeta commented 6 years ago

using the master version getting error "ConsoleAppender" is undefined


<head>
  <script src="log4js-master/log4js/target/files/log4js/js/log4js.min.js" type="text/javascript"></script>
</head>
<body>
  <script>
    var myLogger = new Log4js.getLogger("some-category-name"); //create logger instance
    myLogger.addAppender(new ConsoleAppender(myLogger,false));
    myLogger.setLevel(Log4js.Level.ALL);
    myLogger.info('an info');
    myLogger.warn('a warning');
    myLogger.error('an  ``error');```
  </script>
</body>
foresightyj commented 6 years ago

Yeah, same here. There are some many things that are broken in this library right now. The documentation is so out of sync. The example does not work out of box at all.

You should use: Log4js.ConsoleAppender but again this still does not work. Try instead Log4js.BrowserConsoleAppender

stritti commented 6 years ago

Now there is a compiled version of the lib available again. Also example is updated.