Use locally named loggers rather than writing all logs to the root logger
Fix some logging function calls
This commit is contained in:
parent
9f4d511eb6
commit
b293eed2a3
@ -170,7 +170,7 @@ def fillBlocks(self, box, blockType, blockData = 0):
|
|||||||
Copyright 2010 David Rio Vierra
|
Copyright 2010 David Rio Vierra
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from logging import warn, error, info, debug
|
import logging
|
||||||
from numpy import fromstring
|
from numpy import fromstring
|
||||||
import nbt
|
import nbt
|
||||||
|
|
||||||
@ -183,6 +183,9 @@ from schematic import *
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
warn, error, info, debug = log.warn, log.error, log.info, log.debug
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if sys.platform == "win32":
|
#if sys.platform == "win32":
|
||||||
@ -307,7 +310,6 @@ def loadWorldNumber(i):
|
|||||||
####xxxxx CHECK RESULTS
|
####xxxxx CHECK RESULTS
|
||||||
#
|
#
|
||||||
##import cProfile
|
##import cProfile
|
||||||
#import logging
|
|
||||||
#if __name__=="__main__":
|
#if __name__=="__main__":
|
||||||
# #cProfile.run('testmain()');
|
# #cProfile.run('testmain()');
|
||||||
# logging.basicConfig(format=u'%(levelname)s:%(message)s')
|
# logging.basicConfig(format=u'%(levelname)s:%(message)s')
|
||||||
|
@ -13,7 +13,7 @@ from contextlib import closing
|
|||||||
import gzip
|
import gzip
|
||||||
|
|
||||||
from numpy import *
|
from numpy import *
|
||||||
from logging import warn, error, info, debug
|
import logging
|
||||||
|
|
||||||
import nbt
|
import nbt
|
||||||
from nbt import *
|
from nbt import *
|
||||||
@ -25,6 +25,9 @@ from entity import *
|
|||||||
from faces import *
|
from faces import *
|
||||||
#String constants for common tag names
|
#String constants for common tag names
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
warn, error, info, debug = log.warn, log.error, log.info, log.debug
|
||||||
|
|
||||||
Entities = "Entities"
|
Entities = "Entities"
|
||||||
TileEntities = "TileEntities"
|
TileEntities = "TileEntities"
|
||||||
|
|
||||||
|
12
tests.py
12
tests.py
@ -17,8 +17,10 @@ import shutil
|
|||||||
import os
|
import os
|
||||||
import numpy
|
import numpy
|
||||||
from numpy import *
|
from numpy import *
|
||||||
from logging import info
|
|
||||||
from pymclevel.infiniteworld import MCServerChunkGenerator
|
from pymclevel.infiniteworld import MCServerChunkGenerator
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
info = log.info
|
||||||
#logging.basicConfig(format=u'%(levelname)s:%(message)s')
|
#logging.basicConfig(format=u'%(levelname)s:%(message)s')
|
||||||
#logging.getLogger().level = logging.INFO
|
#logging.getLogger().level = logging.INFO
|
||||||
|
|
||||||
@ -240,10 +242,10 @@ class TestSchematics(unittest.TestCase):
|
|||||||
def testINVEditChests(self):
|
def testINVEditChests(self):
|
||||||
info("INVEdit chest")
|
info("INVEdit chest")
|
||||||
invFile = fromFile("schematics/Chests/TinkerersBox.inv");
|
invFile = fromFile("schematics/Chests/TinkerersBox.inv");
|
||||||
info("Blocks: ", invFile.Blocks)
|
info("Blocks: %s", invFile.Blocks)
|
||||||
info("Data: ", invFile.Data)
|
info("Data: %s", invFile.Data)
|
||||||
info("Entities: ", invFile.Entities)
|
info("Entities: %s", invFile.Entities)
|
||||||
info("TileEntities: ", invFile.TileEntities)
|
info("TileEntities: %s", invFile.TileEntities)
|
||||||
#raise SystemExit;
|
#raise SystemExit;
|
||||||
|
|
||||||
class TestServerGen(unittest.TestCase):
|
class TestServerGen(unittest.TestCase):
|
||||||
|
Reference in New Issue
Block a user