chaosdorf / labello

my little brother, printing is magic!
MIT License
14 stars 3 forks source link

don't log the printed barcodes by default #6

Closed YtvwlD closed 5 years ago

YtvwlD commented 7 years ago

Currently, all HTTP requests (and therefore all printed texts) are logged to stdout. Example:

niklas@panzersperre~/d/labello> python labelprinterServe.py 
started httpserver...
127.0.0.1 - - [09/Jun/2017 19:38:04] "GET /magic HTTP/1.1" 200 -
self.path /magic
127.0.0.1 - - [09/Jun/2017 19:38:04] "GET /app.js HTTP/1.1" 200 -
self.path /app.js
127.0.0.1 - - [09/Jun/2017 19:38:05] "GET /4972b1fd89927b8ae18fb74e4efb3c2f.ttf HTTP/1.1" 200 -
self.path /4972b1fd89927b8ae18fb74e4efb3c2f.ttf
127.0.0.1 - - [09/Jun/2017 19:38:09] "POST / HTTP/1.1" 301 -
application/x-www-form-urlencoded {}
{'text': ['abc'], 'align': ['left'], 'font': ['lettergothic'], 'fontSize': ['42']}
abc
start printing: abc
127.0.0.1 - - [09/Jun/2017 19:38:13] "POST / HTTP/1.1" 301 -
application/x-www-form-urlencoded {}
{'text': ['def'], 'align': ['left'], 'font': ['lettergothic'], 'fontSize': ['42']}
def
start printing: def

This should be turned off in production.

=> TODO: Add option to disable this behaviour.