Skip to content

Conversation

@IronMine
Copy link
Contributor

In this PR there is :

  • Removing some unused functions
  • A new logger system with colors
  • A Warning specific logger ( yellow )
  • An Eroor specific logger ( red )
  • Fixing broken CanyonModded link url to jenkins
  • Optimizing some curl calls
  • A little bit of code cleanup
  • Some proposal ( start-finalExec and start-setupServerProperties)

@itzg
Copy link
Owner

itzg commented Oct 15, 2024

This is a lot of changes for one PR. I know this is hard after the fact, but is there any way you could break this up into a few smaller ones?

@IronMine
Copy link
Contributor Author

will do !

@IronMine
Copy link
Contributor Author

is there some things i listed that you do not want ?

@itzg
Copy link
Owner

itzg commented Oct 15, 2024

Glancing at the changes I like all of it 😃

Actually, keep the PR as is and I'll review more closely when I get a span of time. With that I can raise any specific concerns I find, if any.

@IronMine
Copy link
Contributor Author

Nice perfect !
As you want it is a huge PR i do understand if you would prefer it separate in multiple small ones

@itzg
Copy link
Owner

itzg commented Oct 20, 2024

With new formatted logging, the output from DEBUG set to "true" is getting noisier, such as:

[init] 2024-10-20 16:46:51+00:00
+ logError '         SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH,'
++ getErrorColoredLogString '         SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH,'
++ echo '\033[0;31m[ERROR]          SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH, \033[0m'
+ log
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace

It'll be redundant, but perhaps apply the same shopt-eval suppression of debug -x output around the logError and logWarn calls. All the more reason to keep the number of new logging functions minimal.

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

I have already spent an hour or more on this, so I'm submitting comments so far. Please follow the intent of my suggestions for remainder. Don't go overboard with refactorings. I'm also hoping you didn't use an AI code assistant for this -- some of the variable names are suspicious.

Again, this PR was too large. Don't submit ones this large next time.

itzg
itzg previously approved these changes Oct 22, 2024
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

Thanks so much for working with me on all the feedback I provided.

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

I was doing some final testing and noticed now that the logged string just disappears for errors (and probably warnings):

docker run --rm -it itzg/minecraft-server
[init] Running as uid=1000 gid=1000 with /data as 'drwxr-x--- 2 1000 1000 4096 Oct 22 01:17 /data'
[init] 
[init] 
[init] 
[init] 
[init] 
[init] 

@itzg
Copy link
Owner

itzg commented Oct 22, 2024

Ah, IntelliJ was actually reporting the problem:

image

@IronMine
Copy link
Contributor Author

Thanks so much for working with me on all the feedback I provided.

your are welcome and i apologize for all the time you loose on my PR's ^^

@IronMine
Copy link
Contributor Author

like that ?


if ! isNumeric ${!var_name} ; then
eval "$var_name=$default_value"
export "$var_name"
Copy link
Owner

@itzg itzg Oct 22, 2024

Choose a reason for hiding this comment

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

ShellCheck is reporting a warning here:

image

https://github.com/koalaman/shellcheck/wiki/SC2163

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes because i am doing the thing it thinks i do not want to do

@itzg itzg merged commit bef7b47 into itzg:master Oct 22, 2024
4 checks passed
@IronMine IronMine deleted the refactor branch October 24, 2024 09:19
sevenrats pushed a commit to sevenrats/docker-minecraft-server that referenced this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants