cn.nukkit.utils.LogLevel Java Examples

The following examples show how to use cn.nukkit.utils.LogLevel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NukkitPluginLogger.java    From Plan with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void log(L level, String message, Throwable throwable) {
    switch (level) {
        case CRITICAL:
        case ERROR:
            logger.get().log(LogLevel.ERROR, message, throwable);
            break;
        case WARN:
        default:
            logger.get().log(LogLevel.WARNING, message, throwable);
            break;
    }
}
 
Example #2
Source File: Metrics.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Start measuring statistics. This will immediately create an async repeating task as the plugin and send the
 * initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200
 * ticks.
 *
 * @return True if statistics measuring is running, otherwise false.
 */
public boolean start() {
    // Is metrics already running?
    if (this.taskId != -1) {
        return true;
    }
    // Begin hitting the server with glorious data
    this.taskId = TaskManager.IMP.repeatAsync(new Runnable() {
        private boolean firstPost = true;
        @Override
        public void run() {
            try {
                postPlugin(!this.firstPost);
                // After the first post we set firstPost to
                // false
                // Each post thereafter will be a ping
                this.firstPost = false;
            } catch (IOException e) {
                MainUtil.handleError(e);
                if (Metrics.this.debug) {
                    plugin.getLogger().log(LogLevel.INFO, "[Metrics] " + e.getMessage());
                }
            }
        }
    }, PING_INTERVAL * 1200);
    return true;
}
 
Example #3
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void warning(String message) {
    this.log(LogLevel.WARNING, message);
}
 
Example #4
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void critical(String message, Throwable t) {
    this.log(LogLevel.CRITICAL, message, t);
}
 
Example #5
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void error(String message, Throwable t) {
    this.log(LogLevel.ERROR, message, t);
}
 
Example #6
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void warning(String message, Throwable t) {
    this.log(LogLevel.WARNING, message, t);
}
 
Example #7
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void notice(String message, Throwable t) {
    this.log(LogLevel.NOTICE, message, t);
}
 
Example #8
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void info(String message, Throwable t) {
    this.log(LogLevel.INFO, message, t);
}
 
Example #9
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void debug(String message, Throwable t) {
    this.log(LogLevel.DEBUG, message, t);
}
 
Example #10
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void log(LogLevel level, String message, Throwable t) {
    Server.getInstance().getLogger().log(level, this.pluginName + message, t);
}
 
Example #11
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emergency(String message) {
    this.log(LogLevel.EMERGENCY, message);
}
 
Example #12
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void alert(String message) {
    this.log(LogLevel.ALERT, message);
}
 
Example #13
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void critical(String message) {
    this.log(LogLevel.CRITICAL, message);
}
 
Example #14
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void error(String message) {
    this.log(LogLevel.ERROR, message);
}
 
Example #15
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void alert(String message, Throwable t) {
    this.log(LogLevel.ALERT, message, t);
}
 
Example #16
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void notice(String message) {
    this.log(LogLevel.NOTICE, message);
}
 
Example #17
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void info(String message) {
    this.log(LogLevel.INFO, message);
}
 
Example #18
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void debug(String message) {
    this.log(LogLevel.DEBUG, message);
}
 
Example #19
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void log(LogLevel level, String message) {
    Server.getInstance().getLogger().log(level, this.pluginName + message);
}
 
Example #20
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void emergency(String message, Throwable t) {
    this.log(LogLevel.EMERGENCY, message, t);
}
 
Example #21
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void alert(String message, Throwable t) {
    this.log(LogLevel.ALERT, message, t);
}
 
Example #22
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void critical(String message, Throwable t) {
    this.log(LogLevel.CRITICAL, message, t);
}
 
Example #23
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void error(String message, Throwable t) {
    this.log(LogLevel.ERROR, message, t);
}
 
Example #24
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void warning(String message, Throwable t) {
    this.log(LogLevel.WARNING, message, t);
}
 
Example #25
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void notice(String message, Throwable t) {
    this.log(LogLevel.NOTICE, message, t);
}
 
Example #26
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void info(String message, Throwable t) {
    this.log(LogLevel.INFO, message, t);
}
 
Example #27
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void debug(String message, Throwable t) {
    this.log(LogLevel.DEBUG, message, t);
}
 
Example #28
Source File: PluginLogger.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void log(LogLevel level, String message, Throwable t) {
    Server.getInstance().getLogger().log(level, this.pluginName + message, t);
}
 
Example #29
Source File: PluginLogger.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void notice(String message, Throwable t) {
    this.log(LogLevel.NOTICE, message, t);
}
 
Example #30
Source File: PluginLogger.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void alert(String message) {
    this.log(LogLevel.ALERT, message);
}