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

Support for LogLevel in EffLog #6659

Open
wants to merge 21 commits into
base: dev/feature
Choose a base branch
from

Conversation

EquipableMC
Copy link
Contributor

Description

Added ways to declare severity when logging


Target Minecraft Versions: any
Requirements: none
Related Issues: none

Added wats to declare severity when logging
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
Updated `@Since` to include when severity to logs was added
Copy link
Contributor

@Fusezion Fusezion left a comment

Choose a reason for hiding this comment

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

I'll have more probably just for now here's this

src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
Copy link
Contributor

@Fusezion Fusezion left a comment

Choose a reason for hiding this comment

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

More changes near you. Let's update the #toString(Event e, boolean debug) while we're here, to include severity tags

src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
@sovdeeth sovdeeth added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label May 8, 2024
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

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

Also, have you actually tested this? I'd like to see a screenshot of the output.

src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
@sovdeeth sovdeeth added the breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) label May 8, 2024
@sovdeeth
Copy link
Member

sovdeeth commented May 8, 2024

adding breaking changes due to adding INFO to the output by default.

@EquipableMC
Copy link
Contributor Author

EquipableMC commented May 8, 2024

Also, have you actually tested this? I'd like to see a screenshot of the output.

I have not

@Fusezion
Copy link
Contributor

Fusezion commented May 8, 2024

adding breaking changes due to adding INFO to the output by default.

Sorry but how does this apply a breaking change? Very confused there.

@EquipableMC
Copy link
Contributor Author

Also, have you actually tested this? I'd like to see a screenshot of the output.

I have not

Okay now I have
image

@sovdeeth
Copy link
Member

sovdeeth commented May 8, 2024

Also, have you actually tested this? I'd like to see a screenshot of the output.

I have not

Okay now I have image

I'm mainly concerned about the other severities in console

@EquipableMC
Copy link
Contributor Author

EquipableMC commented May 8, 2024

Also, have you actually tested this? I'd like to see a screenshot of the output.

I have not

Okay now I have image

I'm mainly concerned about the other severities in console

I don't know why exactly warning/severe has a tab

image

@Fusezion
Copy link
Contributor

Fusezion commented May 8, 2024

alright so let's do an actual test equip

on load:
    log "info"
    log "warning" with severity of warning
    log "severe" with severity of severe

this should log on reload my guess is severe will not work but info and warning will

@EquipableMC
Copy link
Contributor Author

alright so let's do an actual test equip

on load:
    log "info"
    log "warning" with severity of warning
    log "severe" with severity of severe

this should log on reload my guess is severe will not work but info and warning will

image

yeah you're right

@sovdeeth
Copy link
Member

sovdeeth commented May 8, 2024

This is why I was talking about a RedirectingLogHandler in discord
You'll need it for warning/error.

@sovdeeth
Copy link
Member

sovdeeth commented May 9, 2024

adding breaking changes due to adding INFO to the output by default.

Sorry but how does this apply a breaking change? Very confused there.

@Fusezion file output would now have an INFO where there was none previously.

@EquipableMC
Copy link
Contributor Author

alright so let's do an actual test equip

on load:

log "info"
log "warning" with severity of warning
log "severe" with severity of severe

this should log on reload my guess is severe will not work but info and warning will

image

yeah you're right

Okay so regarding this, this has been fixed.

EquipableMC and others added 2 commits May 12, 2024 11:11
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffLog.java Outdated Show resolved Hide resolved
default:
levelType = " INFO";
}
logWriter.println( "[" + SkriptConfig.formatDate(System.currentTimeMillis()) + levelType + "] " + message);
Copy link
Member

Choose a reason for hiding this comment

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

you can just directly use logLevel as the toString will return the appropriate name. I am also a little concerned about the addition of the severity into the file since it's a breaking change. I think when people specify severity it will be specifically for the console log level because that actually has an impact on things. if they wanted it part of their file message, they could just prepend their message. we could disallow the file/severity combo in init :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well log is basically just mimicking the console. It's like sending a message to console but in the form of a log file. so this part "I think when people specify severity it will be specifically for the console log level because that actually has an impact on things." I can see where you are coming from, but that just seems weird in my opinion. "if they wanted it part of their file message, they could just prepend their message. we could disallow the file/severity combo in init" by default this returns INFO but I could just make it not return INFO. This should really be up for discussion in my honest opinion

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I think omitting INFO would be fine, avoids breaking changes

Copy link
Member

Choose a reason for hiding this comment

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

im cool with omitting info.

Copy link
Member

Choose a reason for hiding this comment

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

it may be useful to allow users to specifically request info so the prefix can be used in a consistent manner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am just going to omit info. Info just seems useless to be honest. I feel like keeping warning and severe is better

@APickledWalrus APickledWalrus changed the title Improved EffLog Support for LogLevel in EffLog May 15, 2024
Comment on lines +58 to +60
})


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
})
})

@sovdeeth sovdeeth removed the breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants