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

[FIX JENKINS-33705] Use platform line endings #2150

Merged
merged 1 commit into from Mar 23, 2016

Conversation

daniel-beck
Copy link
Member

@daniel-beck daniel-beck force-pushed the JENKINS-33705 branch 2 times, most recently from 5e7029d to 012a92e Compare March 21, 2016 22:17
@batmat
Copy link
Member

batmat commented Mar 21, 2016

👍

1 similar comment
@oleg-nenashev
Copy link
Member

👍

@jtnord
Copy link
Member

jtnord commented Mar 21, 2016

personally I am massively against multi line logs like this as it screws up machine parsing and these should really be multiple log entries...
Many parsers have special cases for exceptions (aka stack traces) - but this is IMO pure evilness...

But whatevers - better than it was.

@daniel-beck
Copy link
Member Author

@jtnord This is mostly the use case for temporarily instances run interactively, where it's easier to check the log than to look on the FS. Do you have an alternative suggestion to this approach? I think highlighting like this is necessary to ensure the password is not overlooked.

@daniel-beck daniel-beck merged commit 3fdd866 into jenkinsci:2.0 Mar 23, 2016
@jtnord
Copy link
Member

jtnord commented Mar 23, 2016

@daniel-beck - thanks for waiting for my response :-)

Yes - the alternative is to

LOGGER.info("***************************************************************************");
LOGGER.info("***************************************************************************");
LOGGER.info("**                                                                       **");
LOGGER.info("** Jenkins initial setup is required. An admin user has been created and **");
LOGGER.info("** a password generated.                                                 **");
LOGGER.info("** Please use the following password to proceed to installation:         **");
LOGGER.info("**                                                                       **");
// TODO pad this with the correct number of spaces
LOGGER.info("** " + setupKey +   "                                                    **");
LOGGER.info("**                                                                       **");
LOGGER.info("**                                                                       **");
// TODO pad this with the correct number of spaces
LOGGER.info("** This may also be found at: " + iapf.getRemote()    + "                **");
LOGGER.info("**                                                                       **");
LOGGER.info("***************************************************************************");
LOGGER.info("***************************************************************************");

@daniel-beck
Copy link
Member Author

@teilo Would padding it to the left be acceptable, so the actual message starts in column ~60?

Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       *************************************************************
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       *************************************************************
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       *************************************************************
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       Created admin user for first launch setup.
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       Please use the following password to proceed to installation:
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       444a3adab53543e386a21a0e81b0242c
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       This may also be found at:
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       /var/lib/jenkins/secrets/initialAdminPassword
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       *************************************************************
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       *************************************************************
Mrz 24, 2016 4:10:56 PM jenkins.install.SetupWizard <init>
INFO:                                                       *************************************************************

My main concern here is that the message should be easy to find and I'm not sure it would be in your approach.

@jtnord
Copy link
Member

jtnord commented Mar 28, 2016

Would padding it to the left be acceptable

No, you are not in control of the logger format - some formatters put the timestamp and message on a single line.
Other formatters abbreviate the classname (j.i.SetupWizard) - so you can't count on 60 to be correct (and others would have a different date format)

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