ExplodingArrows logger help

Post here is you are having problems with any of the tutorials.
Post Reply
KillzyazMadness
Posts: 3
Joined: Sun Mar 25, 2012 4:17 pm

ExplodingArrows logger help

Post by KillzyazMadness »

This is my ExplodingArrows.java main file:
package me.killzyazmadness.ExplodingArrows;

import org.bukkit.plugin.java.JavaPlugin;

public class ExplodingArrows {

	protected ExplodingArrowsLogger log;
	
	public void onEnable(){
		this.log = new ExplodingArrowsLogger(this);
		
	}
	
	public void onDisable(){
		
	}
	
}
And this is my ExplodingArrowsLogger:
package me.killzyazmadness.ExplodingArrows;

import java.util.logging.Logger;

import org.bukkit.plugin.PluginDescriptionFile;

public class ExplodingArrowsLogger {
	
	private ExplodingArrows plugin;
	private Logger log;
	
	public ExplodingArrowsLogger(ExplodingArrows plugin){
		this.plugin = plugin;
		this.log = Logger.getLogger("Minecraft");
	}
	
	private String buildString(String msg){
		PluginDescriptionFile pdFile = plugin.getDescription();
		return"[" + pdFile.getName() + " " + pdFile.getVersion() + "]: " + msg;
	}

	public void info(String msg){
		this.log.info(this.buildString(msg));
	}
	
	public void warn(String msg){
		this.log.warning(this.buildString(msg));
	}
	
	public void sever(String msg){
		this.log.severe(this.buildString(msg));
	}
	
}
It gives me this error: "The method getDescription() is undefined for the type ExplodingArrows" and I don't know what I did wrong, and I am pretty sure you didn't go over logging in the TNT video like you said you did? Thanks for the help :)
KillzyazMadness
Posts: 3
Joined: Sun Mar 25, 2012 4:17 pm

Re: ExplodingArrows logger help

Post by KillzyazMadness »

omg such a noob forgot the extends JavaPlugin at the end. Sorry please remove this.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: ExplodingArrows logger help

Post by jacek »

No problem :)
Image
Post Reply