Change logger format and accelerate empty mapblock init

- Map: Do not create and store name/id mappings for each one of the 4096 air nodes set when initiating an empty mapblock
 - Logger: Use `module` rather than `name` for the format
This commit is contained in:
LeMagnesium 2016-03-11 19:39:46 +01:00
parent 98fcc450be
commit 85e133c0dc
3 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
__pycache__/
*.sqlite
*.mts
env/

View File

@ -10,7 +10,7 @@ import logging
def init_logging(debug=False):
logger = logging.getLogger()
formatter = logging.Formatter("%(asctime)s %(name)s:%(funcName)-25s:%(lineno)-4s %(levelname)-8s %(message)s")
formatter = logging.Formatter("%(asctime)s %(module)s:%(funcName)-25s:%(lineno)-4s %(levelname)-8s %(message)s")
strhandler = logging.StreamHandler()
strhandler.setLevel(logging.DEBUG)

View File

@ -62,8 +62,9 @@ class MapBlock:
for x in range(4096):
self.set_node(x, Node("air"))
self.name_id_mappings = self.create_name_id_mappings()
self.num_name_id_mappings = len(self.name_id_mappings)
self.name_id_mappings = self.create_name_id_mappings()
self.num_name_id_mappings = len(self.name_id_mappings)
def create_name_id_mappings(self):
names = []