mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
Merge pull request #243 from mikeprimm/master
Add verbose: false option to make dynmap much less chatty during startup
This commit is contained in:
commit
dbbff3d04f
@ -417,6 +417,10 @@ worlds:
|
||||
# maximumheight: 127
|
||||
# colorscheme: default
|
||||
|
||||
# Set to true to enable verbose startup messages - can help with debugging map configuration problems
|
||||
# Set to false for a much quieter startup log
|
||||
verbose: true
|
||||
|
||||
# Enables debugging.
|
||||
#debuggers:
|
||||
# - class: org.dynmap.debug.LogDebugger
|
||||
|
@ -78,6 +78,8 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
bukkitConfiguration.load();
|
||||
configuration = new ConfigurationNode(bukkitConfiguration);
|
||||
|
||||
Log.verbose = configuration.getBoolean("verbose", true);
|
||||
|
||||
loadDebuggers();
|
||||
|
||||
tilesDirectory = getFile(configuration.getString("tilespath", "web/tiles"));
|
||||
@ -106,7 +108,7 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
for(Component component : configuration.<Component>createInstances("components", new Class<?>[] { DynmapPlugin.class }, new Object[] { this })) {
|
||||
componentManager.add(component);
|
||||
}
|
||||
Log.info("Loaded " + componentManager.components.size() + " components.");
|
||||
Log.verboseinfo("Loaded " + componentManager.components.size() + " components.");
|
||||
|
||||
registerEvents();
|
||||
|
||||
@ -456,9 +458,9 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
finalConfiguration.extend(templateConfiguration);
|
||||
finalConfiguration.extend(worldConfiguration);
|
||||
|
||||
Log.info("Configuration of world " + world.getName());
|
||||
Log.verboseinfo("Configuration of world " + world.getName());
|
||||
for(Map.Entry<String, Object> e : finalConfiguration.entrySet()) {
|
||||
Log.info(e.getKey() + ": " + e.getValue());
|
||||
Log.verboseinfo(e.getKey() + ": " + e.getValue());
|
||||
}
|
||||
|
||||
return finalConfiguration;
|
||||
@ -467,7 +469,7 @@ public class DynmapPlugin extends JavaPlugin {
|
||||
private ConfigurationNode getDefaultTemplateConfigurationNode(World world) {
|
||||
Environment environment = world.getEnvironment();
|
||||
String environmentName = environment.name().toLowerCase();
|
||||
Log.info("Using environment as template: " + environmentName);
|
||||
Log.verboseinfo("Using environment as template: " + environmentName);
|
||||
return getTemplateConfigurationNode(environmentName);
|
||||
}
|
||||
|
||||
|
@ -6,9 +6,14 @@ import java.util.logging.Logger;
|
||||
public class Log {
|
||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||
protected static final String LOG_PREFIX = "[dynmap] ";
|
||||
public static boolean verbose = false;
|
||||
public static void info(String msg) {
|
||||
log.log(Level.INFO, LOG_PREFIX + msg);
|
||||
}
|
||||
public static void verboseinfo(String msg) {
|
||||
if(verbose)
|
||||
log.log(Level.INFO, LOG_PREFIX + msg);
|
||||
}
|
||||
public static void severe(Exception e) {
|
||||
log.log(Level.SEVERE, LOG_PREFIX + "Exception occured: ", e);
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ public class MapManager {
|
||||
DynmapWorld dynmapWorld = new DynmapWorld();
|
||||
dynmapWorld.world = w;
|
||||
dynmapWorld.configuration = worldConfiguration;
|
||||
Log.info("Loading maps of world '" + worldName + "'...");
|
||||
Log.verboseinfo("Loading maps of world '" + worldName + "'...");
|
||||
for(MapType map : worldConfiguration.<MapType>createInstances("maps", new Class<?>[0], new Object[0])) {
|
||||
map.onTileInvalidated.addListener(invalitateListener);
|
||||
dynmapWorld.maps.add(map);
|
||||
|
@ -245,7 +245,7 @@ public class HeroChatHandler {
|
||||
|
||||
public HeroChatHandler(ConfigurationNode cfg, DynmapPlugin plugin, Server server) {
|
||||
/* If we're enabling hero chat support */
|
||||
Log.info("HeroChat support configured");
|
||||
Log.verboseinfo("HeroChat support configured");
|
||||
this.plugin = plugin;
|
||||
/* Now, get the monitored channel list */
|
||||
hcchannels = cfg.getStrings("herochatchannels", DEF_CHANNELS);
|
||||
@ -278,7 +278,7 @@ public class HeroChatHandler {
|
||||
/* Register event handler */
|
||||
plugin.getServer().getPluginManager().registerEvent(Event.Type.CUSTOM_EVENT,
|
||||
new OurEventListener(), Event.Priority.Monitor, plugin);
|
||||
Log.info("HeroChat integration active");
|
||||
Log.verboseinfo("HeroChat integration active");
|
||||
}
|
||||
/**
|
||||
* Send message from web to appropriate HeroChat channel
|
||||
|
@ -62,11 +62,11 @@ public class KzedMap extends MapType {
|
||||
private static final int CACHE_LIMIT = 10;
|
||||
|
||||
public KzedMap(ConfigurationNode configuration) {
|
||||
Log.info("Loading renderers for map '" + getClass().toString() + "'...");
|
||||
Log.verboseinfo("Loading renderers for map '" + getClass().toString() + "'...");
|
||||
List<MapTileRenderer> renderers = configuration.<MapTileRenderer>createInstances("renderers", new Class<?>[0], new Object[0]);
|
||||
this.renderers = new MapTileRenderer[renderers.size()];
|
||||
renderers.toArray(this.renderers);
|
||||
Log.info("Loaded " + renderers.size() + " renderers for map '" + getClass().toString() + "'.");
|
||||
Log.verboseinfo("Loaded " + renderers.size() + " renderers for map '" + getClass().toString() + "'.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,8 @@
|
||||
name: dynmap
|
||||
main: org.dynmap.DynmapPlugin
|
||||
version: 0.19
|
||||
authors: [FrozenCow, mikeprimm, zeeZ]
|
||||
softdepend: [Permissions]
|
||||
commands:
|
||||
dynmap:
|
||||
description: Controls Dynmap.
|
||||
@ -12,3 +14,7 @@ commands:
|
||||
/<command> render - Renders the tile at your location.
|
||||
/<command> fullrender - (Attempts to) render entire world from your location.
|
||||
/<command> fullrender world - (Attempts to) render entire world 'world'.
|
||||
/<command> stats - Show render statistics.
|
||||
/<command> stats world - Show render statistics for maps on world 'world'.
|
||||
/<command> resetstats - Reset render statistics.
|
||||
/<command> resetstats world - Reset render statistics for maps on world 'world'.
|
||||
|
Loading…
Reference in New Issue
Block a user