// Path: src/main/java/nodebox/Log.java
// public class Log {
//     private static final Logger LOGGER = java.util.logging.Logger.getGlobal();
// 
//     static {
//         try {
//             // Initialize logging directory
//             AppDirs.ensureUserLogDir();
//             File logDir = AppDirs.getUserLogDir();
// 
//             // Initialize file logging
//             FileHandler handler = new FileHandler(logDir.getAbsolutePath() + "/nodebox-%u.log");
//             handler.setFormatter(new SimpleFormatter());
//             LOGGER.addHandler(handler);
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public static void info(String message) {
//         LOGGER.log(Level.INFO, message);
//     }
// 
//     public static void warn(String message) {
//         LOGGER.log(Level.WARNING, message);
//     }
// 
//     public static void warn(String message, Throwable t) {
//         LOGGER.log(Level.WARNING, message, t);
//     }
// 
//     public static void error(String message) {
//         LOGGER.log(Level.SEVERE, message);
//     }
// 
//     public static void error(String message, Throwable t) {
//         LOGGER.log(Level.SEVERE, message, t);
//     }
// 
// }


import nodebox.Log;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
    public void checkerFoundValidUpdate(UpdateChecker checker, Appcast appcast) {
        // Delegate method.
        if (delegate != null)
            if (delegate.checkerFoundValidUpdate(checker, appcast))
                return;

        UpdateAlert alert = new UpdateAlert(this, appcast);
        alert.setLocationRelativeTo(null);
        alert.setVisible(true);
    }

    public void checkerDetectedLatestVersion(UpdateChecker checker, Appcast appcast) {
        // Delegate method.
        if (delegate != null)
            if (delegate.checkerDetectedLatestVersion(checker, appcast))
                return;

        // Show a message that you're using the latest version if you've explicitly checked for updates.
        if (!checker.isSilent()) {
            JOptionPane.showMessageDialog(null, "<html><b>You're up to date!</b><br>\n" + host.getName() + " " + host.getVersion() + " is the latest version available.", "", JOptionPane.INFORMATION_MESSAGE, getHostIcon());
        }
    }

    public void checkerEncounteredError(UpdateChecker checker, Throwable t) {
        hideUpdateCheckDialog();
        // Delegate method.
        if (delegate != null)
            if (delegate.checkerEncounteredError(checker, t))
                return;
        if (checker.isSilent()) {
// Path: src/main/java/nodebox/Log.java
// public class Log {
//     private static final Logger LOGGER = java.util.logging.Logger.getGlobal();
// 
//     static {
//         try {
//             // Initialize logging directory
//             AppDirs.ensureUserLogDir();
//             File logDir = AppDirs.getUserLogDir();
// 
//             // Initialize file logging
//             FileHandler handler = new FileHandler(logDir.getAbsolutePath() + "/nodebox-%u.log");
//             handler.setFormatter(new SimpleFormatter());
//             LOGGER.addHandler(handler);
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public static void info(String message) {
//         LOGGER.log(Level.INFO, message);
//     }
// 
//     public static void warn(String message) {
//         LOGGER.log(Level.WARNING, message);
//     }
// 
//     public static void warn(String message, Throwable t) {
//         LOGGER.log(Level.WARNING, message, t);
//     }
// 
//     public static void error(String message) {
//         LOGGER.log(Level.SEVERE, message);
//     }
// 
//     public static void error(String message, Throwable t) {
//         LOGGER.log(Level.SEVERE, message, t);
//     }
// 
// }


// Path: src/main/java/nodebox/versioncheck/Updater.java
import nodebox.Log;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

    public void checkerFoundValidUpdate(UpdateChecker checker, Appcast appcast) {
        // Delegate method.
        if (delegate != null)
            if (delegate.checkerFoundValidUpdate(checker, appcast))
                return;

        UpdateAlert alert = new UpdateAlert(this, appcast);
        alert.setLocationRelativeTo(null);
        alert.setVisible(true);
    }

    public void checkerDetectedLatestVersion(UpdateChecker checker, Appcast appcast) {
        // Delegate method.
        if (delegate != null)
            if (delegate.checkerDetectedLatestVersion(checker, appcast))
                return;

        // Show a message that you're using the latest version if you've explicitly checked for updates.
        if (!checker.isSilent()) {
            JOptionPane.showMessageDialog(null, "<html><b>You're up to date!</b><br>\n" + host.getName() + " " + host.getVersion() + " is the latest version available.", "", JOptionPane.INFORMATION_MESSAGE, getHostIcon());
        }
    }

    public void checkerEncounteredError(UpdateChecker checker, Throwable t) {
        hideUpdateCheckDialog();
        // Delegate method.
        if (delegate != null)
            if (delegate.checkerEncounteredError(checker, t))
                return;
        if (checker.isSilent()) {
            Log.warn("Update checker encountered error.", t);