Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8125641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:53:04+00:00 2026-06-06T06:53:04+00:00

This is similar to this question, which is about a bash file . We’ve

  • 0

This is similar to this question, which is about a bash file.

We’ve created a log which outputs to the console while we’re running our TestNG tests:

private Log log = LogFactory.getLog(xyz.class);

Later on, during the tests, the log is filled with details to let us know what exactly is being done:

log.info("Setting browser...");
this.browser = browser;
log.info("Completed.");

Right now it’s printing out as you would expect:

Setting browser...
Completed.

I’d like to have this print out on the same line:

Setting browser...

and a few milliseconds later:

Setting browser...Completed.

Is this possible with the LogFactory?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:53:06+00:00Added an answer on June 6, 2026 at 6:53 am

    Without knowing precisely which logging library you are using, I would guess that the answer is almost certainly not unless you want to explicitly specify a newline character everywhere else.

    The java.util.logging (and Log4J) frameworks allow you to plugin formatters to format your statements. You’d need to specify a format which did not end with a newline character. For example, in Log4J. they give an example pattern as

     %-5p [%t]: %m%n
    

    So if you removed everything except the %m (the %n is the newline and the other stuff includes the time and log-level; %t and %p respectively, I think), newlines would not be automatically appended to each statement.

    However, this means that everywhere else, your other log statements would have to look like this:

    log.info("I want this on one line\n");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this on Google, click here , which someone asked a similar question,
i have a table which looks similar to this <asp:TableRow><asp:TableCell>Question 1</asp:TableCell><asp:TableCell ID =Question1Text></asp:TableCell></asp:TableRow> <asp:TableRow><asp:TableCell
I posted a question similar to this earlier, however, after thinking about it and
Ok, there are similar question about this but I'm going a little bit further.
Firstly, I realise that this is a very similar question to this one: Which
I previously asked a similar question on this topic a while back and got
This question is similar to, but not the same as, Logcat errors when running
I've got a question about directional services. There's a similar question on which I
I found this similar question here , but this is really old. Was it
This is a similar question to this one . I would like to convert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.