Logger moved to ru.gravit.utils.logging

This commit is contained in:
zaxar163 2019-01-07 12:05:27 +04:00
parent 5ee0ed089e
commit 77644e656b
No known key found for this signature in database
GPG key ID: CEE900027AE098E0
90 changed files with 107 additions and 91 deletions

View file

@ -80,9 +80,9 @@
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.JVMHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public final class LaunchServer implements Runnable {
public static final class Config {

View file

@ -9,8 +9,8 @@
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public final class MySQLSourceConfig implements AutoCloseable {

View file

@ -17,9 +17,9 @@
import ru.gravit.launchserver.auth.provider.AuthProviderResult;
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public abstract class FileAuthHandler extends AuthHandler {
public static final class Entry extends StreamObject {

View file

@ -12,7 +12,7 @@
import ru.gravit.launcher.HWID;
import ru.gravit.launcher.OshiHWID;
import ru.gravit.utils.HTTPRequest;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class JsonHWIDHandler extends HWIDHandler {
private static final Gson gson = new Gson();

View file

@ -11,7 +11,7 @@
import ru.gravit.launcher.OshiHWID;
import ru.gravit.launchserver.auth.MySQLSourceConfig;
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class MysqlHWIDHandler extends HWIDHandler {
private MySQLSourceConfig mySQLHolder;

View file

@ -15,7 +15,7 @@
import ru.gravit.launcher.Launcher;
import ru.gravit.launchserver.Reloadable;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class JsonFilePermissionsHandler extends PermissionsHandler implements Reloadable {
public String filename = "permissions.json";

View file

@ -4,8 +4,8 @@
import ru.gravit.launchserver.Reconfigurable;
import ru.gravit.launchserver.auth.AuthException;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.logging.LogHelper;
public final class RejectAuthProvider extends AuthProvider implements Reconfigurable {
public RejectAuthProvider() {

View file

@ -13,7 +13,7 @@
import ru.gravit.launcher.Launcher;
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class EXEL4JLauncherBinary extends LauncherBinary {
private final static class Launch4JLog extends Log {

View file

@ -5,7 +5,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class EXELauncherBinary extends LauncherBinary {

View file

@ -13,7 +13,7 @@
import ru.gravit.launchserver.binary.tasks.StripLineNumbersTask;
import ru.gravit.launchserver.binary.tasks.UnpackBuildTask;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class JARLauncherBinary extends LauncherBinary {
public ArrayList<LauncherBuildTask> tasks;

View file

@ -12,8 +12,8 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.logging.LogHelper;
public class ProguardConf {
private static final String charsFirst = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ";

View file

@ -27,8 +27,8 @@
import ru.gravit.launchserver.binary.BuildContext;
import ru.gravit.launchserver.binary.JAConfigurator;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.logging.LogHelper;
public class MainBuildTask implements LauncherBuildTask {
public final Path binaryFile;

View file

@ -2,8 +2,8 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.UnpackHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.nio.file.Path;

View file

@ -6,7 +6,7 @@
import ru.gravit.launchserver.auth.provider.AuthProvider;
import ru.gravit.launchserver.auth.provider.AuthProviderResult;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class AuthCommand extends Command {
public AuthCommand(LaunchServer server) {

View file

@ -6,7 +6,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.launchserver.command.CommandException;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class UUIDToUsernameCommand extends Command {
public UUIDToUsernameCommand(LaunchServer server) {

View file

@ -6,7 +6,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.launchserver.command.CommandException;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class UsernameToUUIDCommand extends Command {
public UsernameToUUIDCommand(LaunchServer server) {

View file

@ -2,7 +2,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class ClearCommand extends Command {
public ClearCommand(LaunchServer server) {

View file

@ -2,7 +2,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class DebugCommand extends Command {
public DebugCommand(LaunchServer server) {

View file

@ -4,7 +4,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.JVMHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class GCCommand extends Command {
public GCCommand(LaunchServer server) {

View file

@ -5,7 +5,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.launchserver.command.CommandException;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class HelpCommand extends Command {
private static void printCommand(String name, Command command) {

View file

@ -2,7 +2,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class LogConnectionsCommand extends Command {
public LogConnectionsCommand(LaunchServer server) {

View file

@ -3,7 +3,7 @@
import ru.gravit.launcher.Launcher;
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class VersionCommand extends Command {
public VersionCommand(LaunchServer server) {

View file

@ -10,7 +10,7 @@
import ru.gravit.launchserver.auth.handler.CachedAuthHandler;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class DumpEntryCacheCommand extends Command {
public DumpEntryCacheCommand(LaunchServer server) {

View file

@ -13,7 +13,7 @@
import ru.gravit.launchserver.command.Command;
import ru.gravit.launchserver.socket.Client;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class DumpSessionsCommand extends Command {
public DumpSessionsCommand(LaunchServer server) {

View file

@ -51,8 +51,8 @@
import ru.gravit.launchserver.command.service.ReloadCommand;
import ru.gravit.launchserver.command.service.ReloadListCommand;
import ru.gravit.launchserver.command.service.SwapAuthProviderCommand;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public abstract class CommandHandler implements Runnable {
private static String[] parse(CharSequence line) throws CommandException {

View file

@ -4,8 +4,8 @@
import jline.console.ConsoleReader;
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.LogHelper.Output;
import ru.gravit.utils.logging.LogHelper;
import ru.gravit.utils.logging.LogHelper.Output;
public final class JLineCommandHandler extends CommandHandler {
private final class JLineOutput implements Output {

View file

@ -9,7 +9,7 @@
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.HttpDownloader;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class DownloadAssetCommand extends Command {

View file

@ -14,7 +14,7 @@
import ru.gravit.launchserver.command.CommandException;
import ru.gravit.utils.HttpDownloader;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class DownloadClientCommand extends Command {

View file

@ -16,9 +16,9 @@
import ru.gravit.launchserver.command.Command;
import ru.gravit.launchserver.command.CommandException;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.helper.SecurityHelper.DigestAlgorithm;
import ru.gravit.utils.logging.LogHelper;
public final class IndexAssetCommand extends Command {
private static Gson gson = new Gson();

View file

@ -4,7 +4,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class SyncBinariesCommand extends Command {
public SyncBinariesCommand(LaunchServer server) {

View file

@ -4,7 +4,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class SyncProfilesCommand extends Command {
public SyncProfilesCommand(LaunchServer server) {

View file

@ -7,7 +7,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class SyncUpdatesCommand extends Command {
public SyncUpdatesCommand(LaunchServer server) {

View file

@ -14,7 +14,7 @@
import ru.gravit.launchserver.command.Command;
import ru.gravit.launchserver.command.CommandException;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class UnindexAssetCommand extends Command {
private static JsonParser parser = new JsonParser();

View file

@ -2,7 +2,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class ConfigCommand extends Command {
public ConfigCommand(LaunchServer server) {

View file

@ -2,7 +2,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class ConfigHelpCommand extends Command {
public ConfigHelpCommand(LaunchServer server) {

View file

@ -2,7 +2,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class ReloadAllCommand extends Command {
public ReloadAllCommand(LaunchServer server) {

View file

@ -2,7 +2,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class ReloadCommand extends Command {
public ReloadCommand(LaunchServer server) {

View file

@ -5,7 +5,7 @@
import ru.gravit.launchserver.auth.provider.AuthProvider;
import ru.gravit.launchserver.auth.provider.RejectAuthProvider;
import ru.gravit.launchserver.command.Command;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class SwapAuthProviderCommand extends Command {
public AuthProvider[] providersCache;

View file

@ -4,8 +4,8 @@
import java.util.Objects;
import ru.gravit.launchserver.Reconfigurable;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public class ReconfigurableManager {
private final HashMap<String, Reconfigurable> RECONFIGURABLE = new HashMap<>();

View file

@ -4,8 +4,8 @@
import java.util.Objects;
import ru.gravit.launchserver.Reloadable;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public class ReloadManager {
private final HashMap<String,Reloadable> RELOADABLES = new HashMap<>();

View file

@ -23,7 +23,7 @@
import ru.gravit.launchserver.response.update.ProfilesResponse;
import ru.gravit.launchserver.response.update.UpdateListResponse;
import ru.gravit.launchserver.response.update.UpdateResponse;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public abstract class Response {
@FunctionalInterface

View file

@ -21,9 +21,9 @@
import ru.gravit.launchserver.response.profile.ProfileByUUIDResponse;
import ru.gravit.launchserver.socket.Client;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public final class AuthResponse extends Response {
private static String echo(int length) {

View file

@ -18,9 +18,9 @@
import ru.gravit.launchserver.response.Response;
import ru.gravit.launchserver.socket.Client;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public final class AuthServerResponse extends Response {
private static String echo(int length) {

View file

@ -11,8 +11,8 @@
import ru.gravit.launchserver.response.Response;
import ru.gravit.launchserver.response.profile.ProfileByUUIDResponse;
import ru.gravit.launchserver.socket.Client;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public final class CheckServerResponse extends Response {

View file

@ -9,9 +9,9 @@
import ru.gravit.launchserver.auth.AuthException;
import ru.gravit.launchserver.response.Response;
import ru.gravit.launchserver.socket.Client;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
public final class JoinServerResponse extends Response {

View file

@ -10,7 +10,7 @@
import ru.gravit.launcher.serialize.SerializeLimits;
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.response.Response;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class ProfileByUUIDResponse extends Response {

View file

@ -10,7 +10,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.response.Response;
import ru.gravit.launchserver.socket.Client;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class ProfilesResponse extends Response {

View file

@ -50,8 +50,8 @@
import ru.gravit.launchserver.response.Response;
import ru.gravit.launchserver.socket.websocket.WebSocketFrameHandler;
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
@SuppressWarnings({"unused", "rawtypes"})
public final class NettyServerSocketHandler implements Runnable, AutoCloseable {

View file

@ -14,8 +14,8 @@
import ru.gravit.launchserver.manangers.hook.SocketHookManager;
import ru.gravit.launchserver.response.Response;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.logging.LogHelper;
public final class ResponseThread implements Runnable {
class Handshake {

View file

@ -16,7 +16,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.manangers.SessionManager;
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class ServerSocketHandler implements Runnable, AutoCloseable {
public interface Listener {

View file

@ -11,7 +11,7 @@
import ru.gravit.launchserver.LaunchServer;
import ru.gravit.launchserver.socket.Client;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class WebSocketFrameHandler extends SimpleChannelInboundHandler<WebSocketFrame> {
public static LaunchServer server;

View file

@ -22,7 +22,7 @@
import ru.gravit.launchserver.socket.websocket.json.auth.JoinServerResponse;
import ru.gravit.launchserver.socket.websocket.json.update.LauncherResponse;
import ru.gravit.launchserver.socket.websocket.json.update.UpdateListResponse;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
@SuppressWarnings({"unused", "rawtypes"})
public class WebSocketService {

View file

@ -3,7 +3,7 @@
import io.netty.channel.ChannelHandlerContext;
import ru.gravit.launchserver.socket.Client;
import ru.gravit.launchserver.socket.websocket.WebSocketService;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class EchoResponse implements JsonResponseInterface {
public final String echo;

View file

@ -6,7 +6,7 @@
import ru.gravit.launchserver.socket.Client;
import ru.gravit.launchserver.socket.websocket.WebSocketService;
import ru.gravit.launchserver.socket.websocket.json.JsonResponseInterface;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class CheckServerResponse implements JsonResponseInterface {
public String serverID;

View file

@ -6,7 +6,7 @@
import ru.gravit.launchserver.socket.Client;
import ru.gravit.launchserver.socket.websocket.WebSocketService;
import ru.gravit.launchserver.socket.websocket.json.JsonResponseInterface;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class JoinServerResponse implements JsonResponseInterface {
public String serverID;

View file

@ -8,7 +8,7 @@
import ru.gravit.launcher.profiles.Texture;
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public final class RequestTextureProvider extends TextureProvider {
public RequestTextureProvider() {

View file

@ -4,7 +4,7 @@
import ru.gravit.utils.helper.EnvHelper;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.JVMHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.nio.file.Path;

View file

@ -5,6 +5,7 @@
import ru.gravit.launcher.gui.JSRuntimeProvider;
import ru.gravit.launcher.gui.RuntimeProvider;
import ru.gravit.utils.helper.*;
import ru.gravit.utils.logging.LogHelper;
import java.time.Duration;
import java.time.Instant;

View file

@ -1,10 +1,10 @@
package ru.gravit.launcher;
import ru.gravit.utils.helper.LogHelper;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import ru.gravit.utils.logging.LogHelper;
public class RequestWorker implements Runnable {
public RequestWorker() {
queue = new LinkedBlockingQueue<>(64);

View file

@ -18,6 +18,7 @@
import ru.gravit.utils.PublicURLClassLoader;
import ru.gravit.utils.helper.*;
import ru.gravit.utils.helper.JVMHelper.OS;
import ru.gravit.utils.logging.LogHelper;
import javax.swing.*;
import java.io.IOException;

View file

@ -13,7 +13,7 @@
import ru.gravit.launcher.request.update.LegacyLauncherRequest;
import ru.gravit.launcher.request.websockets.RequestInterface;
import ru.gravit.launcher.serialize.signed.SignedObjectHolder;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.nio.file.Path;

View file

@ -8,6 +8,7 @@
import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.launcher.serialize.signed.SignedObjectHolder;
import ru.gravit.utils.helper.*;
import ru.gravit.utils.logging.LogHelper;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;

View file

@ -7,8 +7,8 @@
import ru.gravit.launcher.serialize.HInput;
import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

View file

@ -37,6 +37,7 @@
import ru.gravit.launcher.serialize.stream.StreamObject;
import ru.gravit.utils.HTTPRequest;
import ru.gravit.utils.helper.*;
import ru.gravit.utils.logging.LogHelper;
import javax.script.*;
import java.io.BufferedReader;

View file

@ -9,7 +9,7 @@
import javafx.scene.control.Control;
import javafx.scene.control.Skin;
import ru.gravit.launcher.LauncherAPI;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.util.ArrayList;
import java.util.Collections;

View file

@ -5,7 +5,7 @@
import ru.gravit.launcher.HWID;
import ru.gravit.launcher.LauncherHWIDInterface;
import ru.gravit.launcher.OshiHWID;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class OshiHWIDProvider implements LauncherHWIDInterface {
public SystemInfo systemInfo;

View file

@ -6,7 +6,7 @@
import ru.gravit.launcher.hasher.HashedEntry;
import ru.gravit.launcher.profiles.ClientProfile;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.nio.file.Files;

View file

@ -8,7 +8,7 @@
import ru.gravit.launcher.request.uuid.ProfileByUUIDRequest;
import ru.gravit.launcher.request.uuid.ProfileByUsernameRequest;
import ru.gravit.launcher.serialize.SerializeLimits;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.util.UUID;

View file

@ -5,7 +5,7 @@
import ru.gravit.launcher.request.auth.JoinServerRequest;
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
// Used by 1.6.4 and below versions
@LauncherAPI

View file

@ -5,7 +5,8 @@
import com.mojang.authlib.GameProfileRepository;
import com.mojang.authlib.UserAuthentication;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.net.Proxy;

View file

@ -7,8 +7,8 @@
import ru.gravit.launcher.profiles.PlayerProfile;
import ru.gravit.launcher.request.uuid.BatchProfileByUsernameRequest;
import ru.gravit.launcher.serialize.SerializeLimits;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
import java.util.Arrays;
import java.util.UUID;

View file

@ -18,8 +18,8 @@
import ru.gravit.launcher.request.auth.JoinServerRequest;
import ru.gravit.launcher.request.uuid.ProfileByUUIDRequest;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.logging.LogHelper;
import java.net.InetAddress;
import java.util.Base64;

View file

@ -9,8 +9,8 @@
import ru.gravit.launcher.serialize.HInput;
import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.launcher.serialize.SerializeLimits;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;

View file

@ -9,8 +9,8 @@
import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.JVMHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.nio.file.Path;

View file

@ -11,8 +11,8 @@
import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.JVMHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.nio.file.Path;

View file

@ -1,7 +1,7 @@
package ru.gravit.launcher.server;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.lang.instrument.Instrumentation;

View file

@ -12,8 +12,8 @@
import ru.gravit.utils.PublicURLClassLoader;
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.*;
import java.lang.invoke.MethodHandle;

View file

@ -1,11 +1,11 @@
package ru.gravit.launcher;
import ru.gravit.utils.helper.LogHelper;
import java.io.IOException;
import java.lang.instrument.Instrumentation;
import java.util.jar.JarFile;
import ru.gravit.utils.logging.LogHelper;
@LauncherAPI
public final class LauncherAgent {
private static boolean isAgentStarted = false;

View file

@ -3,9 +3,9 @@
import ru.gravit.launcher.serialize.HInput;
import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.launcher.serialize.stream.StreamObject;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.SecurityHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.net.InetSocketAddress;

View file

@ -8,7 +8,7 @@
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.JVMHelper;
import ru.gravit.utils.helper.JVMHelper.OS;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.nio.file.*;

View file

@ -5,8 +5,8 @@
import ru.gravit.launcher.serialize.HOutput;
import ru.gravit.launcher.serialize.stream.EnumSerializer;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.helper.VerifyHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.nio.file.FileVisitResult;

View file

@ -2,7 +2,7 @@
import ru.gravit.utils.PublicURLClassLoader;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.IOException;
import java.net.URISyntaxException;

View file

@ -1,7 +1,7 @@
package ru.gravit.utils;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;

View file

@ -1,6 +1,6 @@
package ru.gravit.utils;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
public class NativeJVMHalt {
public NativeJVMHalt(int haltCode) {

View file

@ -1,7 +1,7 @@
package ru.gravit.utils.downloader;
import ru.gravit.utils.helper.IOHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import javax.net.ssl.HttpsURLConnection;
import java.io.BufferedInputStream;

View file

@ -1,7 +1,7 @@
package ru.gravit.utils.event;
import ru.gravit.utils.helper.CommonHelper;
import ru.gravit.utils.helper.LogHelper;
import ru.gravit.utils.logging.LogHelper;
import java.util.ArrayList;
import java.util.Arrays;

View file

@ -2,6 +2,7 @@
import ru.gravit.launcher.Launcher;
import ru.gravit.launcher.LauncherAPI;
import ru.gravit.utils.logging.LogHelper;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;

View file

@ -1,6 +1,7 @@
package ru.gravit.utils.helper;
import ru.gravit.launcher.LauncherAPI;
import ru.gravit.utils.logging.LogHelper;
import java.io.File;
import java.lang.invoke.MethodHandles;

View file

@ -0,0 +1,7 @@
package ru.gravit.utils.logging;
public interface ILogHandler {
boolean canExc(Throwable t);
String exc(Throwable t);
String process(String str);
}

View file

@ -1,4 +1,4 @@
package ru.gravit.utils.helper;
package ru.gravit.utils.logging;
import org.fusesource.jansi.Ansi;
import org.fusesource.jansi.Ansi.Color;
@ -6,6 +6,7 @@
import org.fusesource.jansi.AnsiOutputStream;
import ru.gravit.launcher.Launcher;
import ru.gravit.launcher.LauncherAPI;
import ru.gravit.utils.helper.IOHelper;
import java.io.*;
import java.nio.file.Path;
@ -34,6 +35,7 @@ public final class LogHelper {
private static final AtomicBoolean STACKTRACE_ENABLED = new AtomicBoolean(Boolean.getBoolean(STACKTRACE_PROPERTY));
private static final Set<Output> OUTPUTS = Collections.newSetFromMap(new ConcurrentHashMap<>(2));
private static final Output STD_OUTPUT;
public static ILogHandler handler = null;
private LogHelper() {
}
@ -71,7 +73,7 @@ public static void debug(String format, Object... args) {
@LauncherAPI
public static void error(Throwable exc) {
error(isStacktraceEnabled() ? toString(exc) : exc.toString());
error(handler.canExc(exc) ? handler.exc(exc) : isStacktraceEnabled() ? toString(exc) : exc.toString());
}
@LauncherAPI
@ -117,8 +119,8 @@ public static void setStacktraceEnabled(boolean stacktraceEnabled) {
@LauncherAPI
public static void log(Level level, String message, boolean sub) {
String dateTime = DATE_TIME_FORMATTER.format(LocalDateTime.now());
println(JANSI ? ansiFormatLog(level, dateTime, message, sub) :
formatLog(level, message, dateTime, sub));
println(JANSI ? ansiFormatLog(level, dateTime, handler.process(message), sub) :
formatLog(level, handler.process(message), dateTime, sub));
}
@LauncherAPI