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
|
||||
"""
|
||||
import os
|
||||
from logging import warn, error, info, debug
|
||||
import logging
|
||||
from numpy import fromstring
|
||||
import nbt
|
||||
|
||||
@ -183,6 +183,9 @@ from schematic import *
|
||||
|
||||
import sys
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
warn, error, info, debug = log.warn, log.error, log.info, log.debug
|
||||
|
||||
|
||||
|
||||
#if sys.platform == "win32":
|
||||
@ -307,7 +310,6 @@ def loadWorldNumber(i):
|
||||
####xxxxx CHECK RESULTS
|
||||
#
|
||||
##import cProfile
|
||||
#import logging
|
||||
#if __name__=="__main__":
|
||||
# #cProfile.run('testmain()');
|
||||
# logging.basicConfig(format=u'%(levelname)s:%(message)s')
|
||||
|
@ -13,7 +13,7 @@ from contextlib import closing
|
||||
import gzip
|
||||
|
||||
from numpy import *
|
||||
from logging import warn, error, info, debug
|
||||
import logging
|
||||
|
||||
import nbt
|
||||
from nbt import *
|
||||
@ -25,6 +25,9 @@ from entity import *
|
||||
from faces import *
|
||||
#String constants for common tag names
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
warn, error, info, debug = log.warn, log.error, log.info, log.debug
|
||||
|
||||
Entities = "Entities"
|
||||
TileEntities = "TileEntities"
|
||||
|
||||
|
12
tests.py
12
tests.py
@ -17,8 +17,10 @@ import shutil
|
||||
import os
|
||||
import numpy
|
||||
from numpy import *
|
||||
from logging import info
|
||||
from pymclevel.infiniteworld import MCServerChunkGenerator
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
info = log.info
|
||||
#logging.basicConfig(format=u'%(levelname)s:%(message)s')
|
||||
#logging.getLogger().level = logging.INFO
|
||||
|
||||
@ -240,10 +242,10 @@ class TestSchematics(unittest.TestCase):
|
||||
def testINVEditChests(self):
|
||||
info("INVEdit chest")
|
||||
invFile = fromFile("schematics/Chests/TinkerersBox.inv");
|
||||
info("Blocks: ", invFile.Blocks)
|
||||
info("Data: ", invFile.Data)
|
||||
info("Entities: ", invFile.Entities)
|
||||
info("TileEntities: ", invFile.TileEntities)
|
||||
info("Blocks: %s", invFile.Blocks)
|
||||
info("Data: %s", invFile.Data)
|
||||
info("Entities: %s", invFile.Entities)
|
||||
info("TileEntities: %s", invFile.TileEntities)
|
||||
#raise SystemExit;
|
||||
|
||||
class TestServerGen(unittest.TestCase):
|
||||
|
Reference in New Issue
Block a user