Skip to content

Commit

Permalink
Issue/#437 Add timestamps to logs (#441)
Browse files Browse the repository at this point in the history
* Add timestamp to logs

* Remove module name from loggers

* Remove unused import
  • Loading branch information
Askaholic authored and Rackover committed Jun 7, 2019
1 parent 1e34ed0 commit 34de3bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 4 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@
from server.geoip_service import GeoIpService
from server.ice_servers.nts import TwilioNTS
from server.ladder_service import LadderService
from server.matchmaker import MatchmakerQueue
from server.player_service import PlayerService
from server.stats.game_stats_service import (AchievementService, EventService,
GameStatsService)

if __name__ == '__main__':
logger = logging.getLogger()
stderr_handler = logging.StreamHandler()
stderr_handler.setFormatter(logging.Formatter('%(levelname)-8s %(name)-30s %(message)s'))
stderr_handler.setFormatter(logging.Formatter(
fmt='%(levelname)-8s %(asctime)s %(name)-30s %(message)s',
datefmt='%b %d %H:%M:%S'
))
logger.addHandler(stderr_handler)
logger.setLevel(config.LOG_LEVEL)

Expand Down
3 changes: 0 additions & 3 deletions server/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
def with_logger(cls):
attr_name = '_logger'
cls_name = cls.__qualname__
module = cls.__module__
assert module is not None
cls_name = module + '.' + cls_name
setattr(cls, attr_name, logging.getLogger(cls_name))
return cls

Expand Down

0 comments on commit 34de3bc

Please sign in to comment.