More finegrained per module logging rather than inheriting the mclevelbase logger

This commit is contained in:
hetmankp 2011-10-12 22:11:02 +11:00
parent b293eed2a3
commit 0caae8d444
6 changed files with 18 additions and 1 deletions

View File

@ -63,6 +63,9 @@ TAG_Compound "MinecraftLevel"
""" """
from mclevelbase import * from mclevelbase import *
log = logging.getLogger(__name__)
warn, error, info, debug = log.warn, log.error, log.info, log.debug
MinecraftLevel = "MinecraftLevel" MinecraftLevel = "MinecraftLevel"
Environment = "Environment" Environment = "Environment"

View File

@ -14,6 +14,9 @@ import sys
import urllib import urllib
import tempfile import tempfile
log = logging.getLogger(__name__)
warn, error, info, debug = log.warn, log.error, log.info, log.debug
#infinite #infinite
Level = 'Level' Level = 'Level'
BlockData = 'BlockData' BlockData = 'BlockData'

View File

@ -8,6 +8,9 @@ from mclevelbase import *
import re import re
log = logging.getLogger(__name__)
warn, error, info, debug = log.warn, log.error, log.info, log.debug
class MCJavaLevel(MCLevel): class MCJavaLevel(MCLevel):

View File

@ -9,6 +9,9 @@ from mclevelbase import *
import tempfile import tempfile
from collections import defaultdict from collections import defaultdict
log = logging.getLogger(__name__)
warn, error, info, debug = log.warn, log.error, log.info, log.debug
def extractLightMap(materials, blocks, heightMap = None): def extractLightMap(materials, blocks, heightMap = None):
"""Computes the HeightMap array for a chunk, which stores the lowest """Computes the HeightMap array for a chunk, which stores the lowest
y-coordinate of each column where the sunlight is still at full strength.""" y-coordinate of each column where the sunlight is still at full strength."""

View File

@ -5,6 +5,10 @@ Created on Jul 22, 2011
''' '''
from mclevelbase import * from mclevelbase import *
import shutil import shutil
log = logging.getLogger(__name__)
warn, error, info, debug = log.warn, log.error, log.info, log.debug
#schematic #schematic
Materials = 'Materials' Materials = 'Materials'

View File

@ -20,7 +20,8 @@ from numpy import *
from pymclevel.infiniteworld import MCServerChunkGenerator from pymclevel.infiniteworld import MCServerChunkGenerator
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
info = log.info warn, error, info, debug = log.warn, log.error, log.info, log.debug
#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