Skip to content

logging library doesn't seem to work with spyder #2572

@pidefrem

Description

@pidefrem

Hello,

I'm trying to run a script using python standard library 'logging'. This script works fine from the command line but when run from Spyder, no log is printed.

My configuration is:
Windows 7
Python 2.7.10 :: Anaconda 2.3.0 (64-bit)
spyder-app 2.3.5.2

The script is:

# -*- coding: utf-8 -*-
"""
Simple test using logging
"""
import logging

# Logger configuration:
log_level = logging.DEBUG 
log_format = '%(levelname)s:%(message)s'

# Testing logger
logger = logging.root
logger.basicConfig = logging.basicConfig(format=log_format, filename='test.log', level=log_level)
logger.info('Testing logger (info)')
logger.debug('Testing logger (debug)')
logger.warning('Testing logger (warn)')
logger.info("")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions