Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adoption of Python logging mechanism
- Loading branch information
giumas
committed
Oct 6, 2015
1 parent
8f4039f
commit deb6d86
Showing
21 changed files
with
152 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
############################################################################## | ||
# Copyright by The HDF Group. # | ||
# All rights reserved. # | ||
# # | ||
# This file is part of the HDF Compass Viewer. The full HDF Compass # | ||
# copyright notice, including terms governing use, modification, and # | ||
# terms governing use, modification, and redistribution, is contained in # | ||
# the file COPYING, which can be found at the root of the source code # | ||
# distribution tree. If you do not have access to this file, you may # | ||
# request a copy from help@hdfgroup.org. # | ||
############################################################################## | ||
from __future__ import absolute_import, division, print_function, unicode_literals | ||
|
||
import logging | ||
|
||
|
||
class LoggingFilter(logging.Filter): | ||
""" An example of logging filter that disables the logging from a specific module """ | ||
def filter(self, record): | ||
# print(record.name) | ||
if record.name.startswith('hdf_compass.compass_viewer.info'): | ||
return False | ||
return True | ||
|
||
|
||
# logging settings | ||
logger = logging.getLogger() | ||
logger.setLevel(logging.NOTSET) | ||
ch = logging.StreamHandler() | ||
ch.setLevel(logging.DEBUG) # change to WARNING to minimize verbosity, DEBUG for high verbosity | ||
ch_formatter = logging.Formatter('%(levelname)-7s %(name)s.%(funcName)s:%(lineno)d > %(message)s') | ||
ch.setFormatter(ch_formatter) | ||
# ch.addFilter(LoggingFilter()) # uncomment to activate the logging filter | ||
logger.addHandler(ch) | ||
|
||
from . import run | ||
|
||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.