Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug V3 Re-Write #158

Open
wants to merge 4 commits into
base: 2.6.2
Choose a base branch
from
Open

Debug V3 Re-Write #158

wants to merge 4 commits into from

Conversation

KillerOfPie
Copy link
Collaborator

This still needs to have File Logging Implemented but other than that It should be good to go...

  • Removed Enable Debug Setting
  • Added DebugToConsole and DebugToFile Settings
  • Debug settings now take lists of Debug Level Names
  • Added DebugLevels#match
  • Old Debug setting reading moved to DebugV2
  • New debug settings run with DebugV3
  • Common code is contained in Debug
  • Removed old/un-usable config fixes

Pull Request Etiquette

There are several guidelines you should follow in order for your Pull Request to be merged.
Replace [ ] with [x] to cross the checkbox.

It is sometimes better to include more related changes in a single commit.
If you find yourself having an overwhelming amount of commits, you
can rebase your branch.

Changes

Replace this sentence with a description of che changes introduced by this PR.

- Removed Enable Debug Setting
- Added DebugToConsole and DebugToFile Settings
- Debug settings now take lists of Debug Level Names
- Added DebugLevels#match
- Old Debug setting reading moved to DebugV2
- New debug settings run with DebugV3
- Common code is contained in Debug
- Removed old/un-usable config fixes
- Added isNull method to check before use
- Added check for NULL value and reset/re-read setting if true
- Catch-up to 2.6.2
- Added JSON_SAVING and JSON_LOADING debug
- Changed isMap call to isList(whoops...)
- Changed return type to Optional<List<String>>
- Changed boolean check in Debug to utilize Optional#orElse
Copy link
Member

@SparklingComet SparklingComet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but I dont agree with the Debug class hierarchy... It should not be this complex
Also look at the generics thing and make sure that works as expected


return !debugDestination.isEmpty();
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this thing still here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returns enable/disable for the system. If nothing is loaded debug should be disabled.


return !debugToConsole.isEmpty();
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just get rid of DebugV2 and merge this with Debug.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made seperate so that I can break out later. Still not sure if this will make it to full release

@@ -115,6 +121,21 @@ public Map<String, Object> asMap() {
return null;
}

public boolean isList() {
return !isNull() && obj instanceof List;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this works... you need to be careful with generics
class ObjectHolder<T> means you need to check obj instanceof List<? extends T>
this is not the same, List<String> is not compatible or a subclass of List<Object>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you right, thats a goof.

Well, it shouldn't be ? extends T because the T would be a list(and most likely a String List)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right, I meant T is whatever obj is a list of... maybe instanceof List<?> should be fine then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants