this.log = this.getLogger(); error

Discussion in 'Plugin Development' started by German121314, Aug 7, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    German121314

    Hi! I have the next code:

    Code:java
    1. public class UpdateCheckerPlugin {
    2.  
    3. protected Logger log;
    4. protected UpdateChecker updateChecker;
    5.  
    6.  
    7.  
    8. public void onEnable(){
    9.  
    10. this.log = this.getLogger();
    11.  
    12. this.updateChecker = new UpdateChecker(this, "link is here");
    13. this.updateChecker.updateNeeded();
    14. }



    but this.log = this.getLogger(); gives me an error! I want it work without method like here:

     
  2. Offline

    adam753

    getLogger() is a function that belongs to your main plugin class, i.e. the one that extends JavaPlugin. Just like in the video, UpdateCheckerPlugin should say "extends JavaPlugin" after it.
    Surely you could have found that out by reading the error?
     
Thread Status:
Not open for further replies.

Share This Page