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 6686245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:08:59+00:00 2026-05-26T05:08:59+00:00

EDIT The blank spaces were added by an obscure statement in the code, somewhere

  • 0

EDIT The blank spaces were added by an obscure statement in the code, somewhere deep in a sub-function. Once this was removed, the logging output is nice… Therefore I close the subject.

The redirection of console logging to stderrpermitted to highlight this easily, so thanks to commenters!


I’m using Python logging module to handle logging from my project, both to log file and standard output. This works quite nice, based on a config file, with different logging levels.

Problem: to standard output, lines are starting with blank spaces. This seems to be linked to the time elapsed between two writings (something like one space per second).

For sure, I made an error in logging config file, as I’m really not at ease with it, but I cannot identify where. Changing logging level for all to be set at the same will not change anything. Could someone bring some help?


Report file content:

2011-10-11 17:25:43,911 : INFO : P-Tool : P-Tool launched from command-line
2011-10-11 17:25:43,927 : INFO : P-Tool : Starting instantiation of tools
2011-10-11 17:25:43,959 : INFO : P-Tool : Initialization completed
2011-10-11 17:25:43,959 : INFO : P-Tool : Execution started
2011-10-11 17:25:44,973 : WARNING : P-Tool : Process Project File CRC check FAILED, [...]
2011-10-11 17:25:44,973 : INFO : P-Tool : XSD version check passed: Process [...]
2011-10-11 17:25:44,973 : ERROR : P-Tool : XSD validation FAILED for Process[...]
2011-10-11 17:25:44,973 : INFO : P-Tool : Process Call found, ID: 1, short name: [...]
2011-10-11 17:25:44,973 : INFO : lib.tools.I-Tool : importing AC_ICD: [...]
2011-10-11 17:25:52,983 : INFO : lib.tools.I-Tool : importing AC_ICD: [...]
2011-10-11 17:26:00,009 : INFO : lib.tools.V-Tool : verifying project [...] 

Standard output:

INFO : P-Tool : P-Tool launched from command-line
INFO : P-Tool : Starting instantiation of tools
INFO : P-Tool : Initialization completed
INFO : P-Tool : Execution started
 WARNING : P-Tool : Process Project File CRC check FAILED, [...]
INFO : P-Tool : XSD version check passed: Process Project [...]
ERROR : P-Tool : XSD validation FAILED for Process Project [...]
INFO : P-Tool : Process Call found, ID: 1, short [...]
INFO : lib.tools.I-Tool : importing AC_ICD: [...]
  INFO : lib.tools.I-Tool : importing AC_ICD: [...]
  INFO : lib.tools.V-Tool : verifying project [...]
 ERROR : P-Tool : no CRC found in "Project\Rep[...]
INFO : lib.tools.G-Tool : generating binary for [...]
 ERROR : P-Tool : no CRC found in "Project\Reports[...]
INFO : lib.tools.LAF Writer : LAF writing started, [...]

(note how the lines are starting with blank space)

Here is how I configure the logging module:

# in the module p_tool.py
# defining the logging
LOG_CONFIG = 'logging.conf'
logging.config.fileConfig(os.path.join(os.path.split(__file__)[0], 
                                       'resources', 
                                       LOG_CONFIG))
logger = logging.getLogger('P-Tool')

[...]
# adding some message
logger.info('message to logger')

and the logging configuration file:

# logging.conf
[loggers]
keys=root,P-Tool

[handlers]
keys=consoleHandler,logFileHandler

[formatters]
keys=consoleFormatter,fileFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler,logFileHandler

[logger_P-Tool]
level=DEBUG
handlers=consoleHandler,logFileHandler
qualname=P-Tool
propagate=0

[handler_consoleHandler]
class=StreamHandler
level=INFO
formatter=consoleFormatter
args=(sys.stdout,)

[handler_logFileHandler]
class=FileHandler
level=DEBUG
formatter=fileFormatter
args=('p_tool_log.txt','w')

[formatter_fileFormatter]
format=%(asctime)s : %(levelname)s : %(name)s : %(message)s
datefmt=

[formatter_consoleFormatter]
format=%(levelname)s : %(name)s : %(message)s
datefmt=
  • 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-05-26T05:09:00+00:00Added an answer on May 26, 2026 at 5:09 am

    As written above, I made two mistakes in my code. Therefore, there’s nothing wrong with the logging module or the configuration I made of it.

    The blank spaces were added by an obscure statement in the code, somewhere deep in a sub-function. Once this was removed, the logging output is nice… Therefore I close the subject.

    The redirection of console logging to stderr permitted to highlight this easily, so thanks to commenters!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
function new_photo() { if( !empty($this->data)) { $this->data['Photo']['showcase_id'] = $this->Session->read('CurrShowcase.id'); $this->data['Photo']['added'] = date(Y-m-d H:i:s); $this->Showcase->Photo->save($this->data);
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: This question is more about language engineering than C++ itself. I used C++
The output of this code looks pretty much identical in FF, Chrome and Safari
Title edit: capitalization fixed and 'for python' added. Is there a better or more
Alright, so I have a list of 296 data points and four blank spaces.
A while ago I asked this question: using xslt stylesheet to convert xhtml blank
Why can't simplyscroll handle this div which has nested divs? ADDED INFO The scrolling

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.