Skip to content

Commit

Permalink
Add option "Application Log Level" to preferences
Browse files Browse the repository at this point in the history
This option controls the minimum severity level for log messages to be printed to the console.
Option can be found in Preferences > GUI and Text section.
  • Loading branch information
Argent77 committed Sep 3, 2024
1 parent c220eba commit 27c153c
Show file tree
Hide file tree
Showing 244 changed files with 949 additions and 266 deletions.
4 changes: 4 additions & 0 deletions src/org/infinity/AppOption.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.stream.Collectors;

import org.infinity.gui.menu.BrowserMenuBar;
import org.infinity.gui.menu.LogLevel;
import org.infinity.gui.menu.OptionsMenuItem;
import org.infinity.gui.menu.OverrideMode;
import org.infinity.gui.menu.ResRefMode;
Expand Down Expand Up @@ -284,6 +285,9 @@ public class AppOption {
"Show State/Response Numbers", true);

// Category: Visual Options
/** Menu Options > Visual Options: AppLogLevel (Integer, Default: Level.INFO) */
public static final AppOption APP_LOG_LEVEL = new AppOption(NearInfinity.APP_LOG_LEVEL, "Application Log Level",
LogLevel.INFO.ordinal());
/** Menu Options > Visual Options: ShowResRef (Integer, Default: ResRefMode.RefName) */
public static final AppOption SHOW_RES_REF = new AppOption(OptionsMenuItem.OPTION_SHOWRESREF, "Show ResourceRef As",
ResRefMode.RefName.ordinal());
Expand Down
3 changes: 2 additions & 1 deletion src/org/infinity/NearInfinity.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
import org.infinity.util.IdsMapCache;
import org.infinity.util.IniMapCache;
import org.infinity.util.LauncherUtils;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.Operation;
import org.infinity.util.Platform;
Expand All @@ -133,7 +134,6 @@
import org.infinity.util.io.FileEx;
import org.infinity.util.io.FileManager;
import org.infinity.util.tuples.Couple;
import org.tinylog.Logger;

public final class NearInfinity extends JFrame implements ActionListener, ViewableContainer {
// the current Near Infinity version
Expand All @@ -158,6 +158,7 @@ public final class NearInfinity extends JFrame implements ActionListener, Viewab
public static final String OPTION_GLOBAL_FONT_SIZE = "GlobalFontSize";
public static final String APP_UI_SCALE_ENABLED = "AppUiScaleEnabled";
public static final String APP_UI_SCALE_FACTOR = "AppUiScaleFactor";
public static final String APP_LOG_LEVEL = "AppLogLevel";

private static final String STATUSBAR_TEXT_FMT = "Welcome to Near Infinity! - %s @ %s - %d files available";

Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/BCSIDSChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
import org.infinity.resource.bcs.ScriptType;
import org.infinity.resource.key.ResourceEntry;
import org.infinity.search.AbstractSearcher;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.tinylog.Logger;

/** Performs checking {@link BcsResource BCS} & {@code BS} resources. */
public final class BCSIDSChecker extends AbstractSearcher implements Runnable, ActionListener, ListSelectionListener {
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/CreInvChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
import org.infinity.resource.cre.Item;
import org.infinity.resource.key.ResourceEntry;
import org.infinity.search.AbstractSearcher;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.tinylog.Logger;

/** Performs checking {@link CreResource CRE} & {@code CHR} resources. */
public final class CreInvChecker extends AbstractSearcher implements Runnable, ActionListener, ListSelectionListener {
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/DialogChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
import org.infinity.resource.dlg.DlgResource;
import org.infinity.resource.key.ResourceEntry;
import org.infinity.search.AbstractSearcher;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.tinylog.Logger;

/** Performs checking {@link DlgResource DLG} resources. */
public final class DialogChecker extends AbstractSearcher
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/ResourceUseChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
import org.infinity.resource.dlg.Transition;
import org.infinity.resource.key.ResourceEntry;
import org.infinity.resource.text.PlainTextResource;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.StringTable;
import org.tinylog.Logger;

public final class ResourceUseChecker extends AbstractChecker
implements Runnable, ListSelectionListener, ActionListener {
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/ScriptChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
import org.infinity.resource.bcs.ScriptMessage;
import org.infinity.resource.key.ResourceEntry;
import org.infinity.search.AbstractSearcher;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.tinylog.Logger;

/** Performs checking {@link BcsResource BCS} & {@code BS} resources. */
public final class ScriptChecker extends AbstractSearcher
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/StringUseChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
import org.infinity.search.SearchClient;
import org.infinity.search.SearchMaster;
import org.infinity.search.StringReferenceSearcher;
import org.infinity.util.Logger;
import org.infinity.util.LuaEntry;
import org.infinity.util.LuaParser;
import org.infinity.util.Misc;
import org.infinity.util.StringTable;
import org.infinity.util.Table2da;
import org.infinity.util.Table2daCache;
import org.tinylog.Logger;

public final class StringUseChecker extends AbstractSearcher
implements Runnable, ListSelectionListener, SearchClient, ActionListener {
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/StringValidationChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
import org.infinity.resource.key.FileResourceEntry;
import org.infinity.resource.key.ResourceEntry;
import org.infinity.search.AbstractSearcher;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.StringTable;
import org.infinity.util.io.StreamUtils;
import org.tinylog.Logger;

public class StringValidationChecker extends AbstractSearcher
implements Runnable, ActionListener, ListSelectionListener {
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/StrrefIndexChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
import org.infinity.resource.key.ResourceEntry;
import org.infinity.resource.text.PlainTextResource;
import org.infinity.search.StringReferenceSearcher;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.StringTable;
import org.infinity.util.Table2da;
import org.infinity.util.Table2daCache;
import org.tinylog.Logger;

public class StrrefIndexChecker extends AbstractChecker implements ListSelectionListener {
private final ChildFrame resultFrame = new ChildFrame("Illegal strrefs found", true);
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/check/StructChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
import org.infinity.resource.sto.ItemSale11;
import org.infinity.resource.wed.Overlay;
import org.infinity.resource.wed.Tilemap;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.StringTable;
import org.tinylog.Logger;

public final class StructChecker extends AbstractChecker implements ListSelectionListener {
private static final String[] FILETYPES = { "ARE", "CHR", "CHU", "CRE", "DLG", "EFF", "GAM", "ITM", "PRO", "SPL",
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/Bestiary.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
import org.infinity.util.IniMapCache;
import org.infinity.util.IniMapEntry;
import org.infinity.util.IniMapSection;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.StringTable;
import org.tinylog.Logger;

/**
* Datatype for {@link GamResource#GAM_BESTIARY Bestiary} field of the {@link GamResource GAM} resource.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/ColorPicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
import org.infinity.icon.Icons;
import org.infinity.resource.AbstractStruct;
import org.infinity.resource.graphics.ColorConvert;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.tinylog.Logger;

/**
* Implements a RGB color picker control.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/ColorValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
import org.infinity.util.IdsMap;
import org.infinity.util.IdsMapCache;
import org.infinity.util.IdsMapEntry;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.Table2da;
import org.infinity.util.Table2daCache;
import org.tinylog.Logger;

/**
* Field that represents indexed color or color range.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/Datatype.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import org.infinity.resource.AbstractStruct;
import org.infinity.resource.StructEntry;
import org.infinity.util.Logger;
import org.infinity.util.io.ByteBufferOutputStream;
import org.infinity.util.io.StreamUtils;
import org.tinylog.Logger;

/**
* Base class for all types of fields. Supplies base properties for fields: its name (not stored in the file), offset in
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/DecNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Objects;

import org.infinity.resource.AbstractStruct;
import org.tinylog.Logger;
import org.infinity.util.Logger;

/**
* Field that represents numerical value which is usually edited in a decimal mode.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/EffectType.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.infinity.resource.AbstractStruct;
import org.infinity.resource.StructEntry;
import org.infinity.resource.effects.BaseOpcode;
import org.tinylog.Logger;
import org.infinity.util.Logger;

public final class EffectType extends Bitmap implements UpdateListener {
// EffectType-specific field labels
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/FloatNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import java.util.Objects;

import org.infinity.resource.AbstractStruct;
import org.infinity.util.Logger;
import org.infinity.util.io.StreamUtils;
import org.tinylog.Logger;

/**
* Field that represents numerical value which is usually edited in a floating point mode.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/HexNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import java.nio.ByteBuffer;

import org.tinylog.Logger;
import org.infinity.util.Logger;

public class HexNumber extends DecNumber {
public HexNumber(ByteBuffer buffer, int offset, int length, String desc) {
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/ItemTypeBitmap.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import org.infinity.util.IdsMap;
import org.infinity.util.IdsMapCache;
import org.infinity.util.IdsMapEntry;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.Table2da;
import org.infinity.util.Table2daCache;
import org.tinylog.Logger;

/**
* Specialized {@link HashBitmap} that uses a mix of hardcoded entries and custom entries from ITEMTYPE.2DA
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/MultiNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import org.infinity.gui.ViewerUtil;
import org.infinity.gui.menu.BrowserMenuBar;
import org.infinity.resource.AbstractStruct;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.tinylog.Logger;

/**
* A Number object consisting of multiple values of a given number of bits.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/ResourceRef.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
import org.infinity.resource.ResourceFactory;
import org.infinity.resource.key.ResourceEntry;
import org.infinity.resource.sound.SoundResource;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.io.StreamUtils;
import org.tinylog.Logger;

/**
* Represents reference to another resource in game. This resource can be sound, item, dialog, creature, image.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/SpellProtType.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import org.infinity.util.IdsMap;
import org.infinity.util.IdsMapCache;
import org.infinity.util.IdsMapEntry;
import org.infinity.util.Logger;
import org.infinity.util.Table2da;
import org.infinity.util.Table2daCache;
import org.tinylog.Logger;

/**
* Specialized Bitmap type for translating SPLPROT.2DA data into human-readable descriptions.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/StringRef.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
import org.infinity.resource.sav.SavResourceEntry;
import org.infinity.resource.to.TohResource;
import org.infinity.search.StringReferenceSearcher;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.StringTable;
import org.infinity.util.io.FileManager;
import org.tinylog.Logger;

/**
* A struct field that represents reference to string in a talk table file (dialog.tlk or dialogF.tlk).
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/Summon2daBitmap.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import java.util.TreeMap;

import org.infinity.resource.ResourceFactory;
import org.infinity.util.Logger;
import org.infinity.util.Table2da;
import org.infinity.util.Table2daCache;
import org.tinylog.Logger;

/** Specialized HashBitmap type for parsing {@code SMTABLES.2DA} from IWDEE. */
public class Summon2daBitmap extends HashBitmap {
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/UnknownDecimal.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.nio.ByteBuffer;

import org.infinity.resource.AbstractStruct;
import org.tinylog.Logger;
import org.infinity.util.Logger;

/**
* Field that represents binary data in decimal format in their editor.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/datatype/UnsignHexNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import java.nio.ByteBuffer;

import org.tinylog.Logger;
import org.infinity.util.Logger;

public class UnsignHexNumber extends UnsignDecNumber {
public UnsignHexNumber(ByteBuffer buffer, int offset, int length, String desc) {
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/gui/BIFFEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
import org.infinity.resource.key.BIFFWriter;
import org.infinity.resource.key.FileResourceEntry;
import org.infinity.resource.key.ResourceEntry;
import org.infinity.util.Logger;
import org.infinity.util.io.FileEx;
import org.infinity.util.io.FileManager;
import org.infinity.util.io.StreamUtils;
import org.tinylog.Logger;

public final class BIFFEditor implements ActionListener, ListSelectionListener, Runnable {
private static boolean firstRun = true;
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/gui/BcsDropFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
import org.infinity.resource.bcs.ScriptMessage;
import org.infinity.resource.bcs.ScriptType;
import org.infinity.resource.key.FileResourceEntry;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.io.FileEx;
import org.infinity.util.io.FileManager;
import org.tinylog.Logger;

public class BcsDropFrame extends ChildFrame implements ActionListener, ListSelectionListener {
private final JButton bOpen = new JButton("Open selected", Icons.ICON_OPEN_16.getIcon());
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/gui/BookmarkEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
import org.infinity.NearInfinity;
import org.infinity.gui.menu.Bookmark;
import org.infinity.resource.Profile;
import org.infinity.util.Logger;
import org.infinity.util.Platform;
import org.infinity.util.SimpleListModel;
import org.infinity.util.io.FileManager;
import org.tinylog.Logger;

/**
* Edit or remove bookmarked games.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/gui/ChildFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.infinity.resource.Viewable;
import org.infinity.resource.ViewableContainer;
import org.infinity.resource.graphics.BamResource;
import org.tinylog.Logger;
import org.infinity.util.Logger;

public class ChildFrame extends JFrame {
private static final List<ChildFrame> WINDOWS = new ArrayList<>();
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/gui/ChooseBIFFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.infinity.resource.ResourceFactory;
import org.infinity.resource.key.AbstractBIFFReader;
import org.infinity.resource.key.BIFFEntry;
import org.tinylog.Logger;
import org.infinity.util.Logger;

final class ChooseBIFFrame extends ChildFrame implements ActionListener {
private final BIFFEditor editor;
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/gui/DebugConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import org.infinity.gui.menu.BrowserMenuBar;
import org.infinity.icon.Icons;
import org.infinity.resource.Profile;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.io.FileEx;
import org.tinylog.Logger;

public class DebugConsole extends ChildFrame implements ActionListener {
private final JButton bClearConsole = new JButton("Clear", Icons.ICON_NEW_16.getIcon());
Expand Down
4 changes: 1 addition & 3 deletions src/org/infinity/gui/FontChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@
import javax.swing.text.JTextComponent;
import javax.swing.text.Position;

import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.tinylog.Logger;

//import org.infinity.util.Misc;

/**
* The {@code FontChooser} class is a swing component for font selection. This class has {@code FileChooser} like APIs.
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/gui/InfinityAmp.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
import org.infinity.resource.mus.Entry;
import org.infinity.resource.sound.AudioBuffer;
import org.infinity.resource.sound.AudioPlayer;
import org.infinity.util.Logger;
import org.infinity.util.Misc;
import org.infinity.util.SimpleListModel;
import org.infinity.util.io.StreamUtils;
import org.tinylog.Logger;

public final class InfinityAmp extends ChildFrame
implements ActionListener, ListSelectionListener, Runnable, Closeable {
Expand Down
Loading

0 comments on commit 27c153c

Please sign in to comment.