From 25d0e7217ef327de21a5f6fad21509a9bc539c16 Mon Sep 17 00:00:00 2001 From: Gabor Guzmics Date: Wed, 15 Apr 2015 01:53:55 +0200 Subject: [PATCH] some commenting for clearness. --- logs/base.py | 22 +++++++++++++++++++++- logs/chat.py | 8 ++++++-- logs/combat.py | 15 +++++++-------- logs/game.py | 7 +++++++ 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/logs/base.py b/logs/base.py index fd95e7f..6a4cc93 100644 --- a/logs/base.py +++ b/logs/base.py @@ -1,8 +1,28 @@ import logging +""" + Base Class for a Logentry is Log. Stacktrace is an exception, which gets injected if a stacktrace + is assumed, and swallows all following unrecognized logs. + + -> It gets parsed by a Logstream, like the Logfile, but might also be used to be feeded + by live-streams of currently open log files. + + -> Logfiles is responsible to read whole packs of files, and + -> Sessions are responsible for reading whole directories. + + A Log object usually will expand itself containing "values", and is responsible to retain all dynamic data needed to describe it in unpack() + The classmethod is_handler should pre-scan a log, which is usually a dict containing the actual log in log['log'] + but it could be a string aswell. + + clean is called to make a log object independent of its source information, and delete all incoming data, so it becomes sleek. + reviewed is an internal boolean, which supposed to be saved on successful unpack, unpack should ignore already unpacked logs. + matcher is a regex object to match, or a list of them. + trash is a boolean flag to indicate, this log is possibly unknown information or unneeded, and should be removed or ignored. +""" + L_CMBT = 'CMBT' L_WARNING = 'WARNING' -L_NET = 'NET' +L_NET = 'NET' # Not supported in near future. L_CHAT = 'CHAT' class Log(object): diff --git a/logs/chat.py b/logs/chat.py index de2a7ad..bf31589 100644 --- a/logs/chat.py +++ b/logs/chat.py @@ -2,9 +2,13 @@ from logs.base import Log, L_WARNING, Stacktrace import re """ -Responsible for Chat Log. + Responsible for Chat Log. + + Anything related to chat gets logged here, basicly interesting for chat related stuff mainly. + Channel leaving and joining and connection to the chat server get logged here too. -ColorChart: +------------------------------- +Maybe add something to create a ColorChart of usernames? between 33-33-33 and FF-33 FF-33 FF-33 """ diff --git a/logs/combat.py b/logs/combat.py index c6b4b5a..b2f92e6 100644 --- a/logs/combat.py +++ b/logs/combat.py @@ -1,11 +1,13 @@ # -*- coding: utf-8 -*- - """ - todo: - - English implementation first. - - parsing combat.log + Primary Packets for Combat.Log Files. - Prosa. + This is the most important part for dealing with actual statistics, since every action taken + in a combat instance gets logged here. + + + ------------------------------------ + Note: All logs start with something like 23:53:29.137 | LOGDATA @@ -16,9 +18,6 @@ combat logs: 01:04:38.805 CMBT | - - - The typical log entry """ import re from base import Log, L_CMBT, Stacktrace diff --git a/logs/game.py b/logs/game.py index c889384..b5052d6 100644 --- a/logs/game.py +++ b/logs/game.py @@ -4,6 +4,13 @@ from logs.base import Log, L_WARNING, Stacktrace import re """ + This deals with the Game.Log file + This file records lots of junk, but is needed to establish actions taken between combat sessions, + or retrieve more detailed information about running instances. + It is also the typical place for a Stacktrace to happen. + + +-------------------------------------- Interesting Lines: 23:16:27.427 | Steam initialized appId 212070, userSteamID 1|1|4c5a01, userName 'G4bOrg'