some commenting for clearness.

This commit is contained in:
Gabor Körber 2015-04-15 01:53:55 +02:00
parent 62edcc0a77
commit 25d0e7217e
4 changed files with 41 additions and 11 deletions

View File

@ -1,8 +1,28 @@
import logging 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_CMBT = 'CMBT'
L_WARNING = 'WARNING' L_WARNING = 'WARNING'
L_NET = 'NET' L_NET = 'NET' # Not supported in near future.
L_CHAT = 'CHAT' L_CHAT = 'CHAT'
class Log(object): class Log(object):

View File

@ -2,9 +2,13 @@
from logs.base import Log, L_WARNING, Stacktrace from logs.base import Log, L_WARNING, Stacktrace
import re import re
""" """
Responsible for Chat Log. Responsible for Chat Log.
ColorChart: 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.
-------------------------------
Maybe add something to create a ColorChart of usernames?
between 33-33-33 and FF-33 FF-33 FF-33 between 33-33-33 and FF-33 FF-33 FF-33
""" """

View File

@ -1,11 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
todo: Primary Packets for Combat.Log Files.
- English implementation first.
- parsing combat.log
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 All logs start with something like
23:53:29.137 | LOGDATA 23:53:29.137 | LOGDATA
@ -16,9 +18,6 @@
combat logs: combat logs:
01:04:38.805 CMBT | 01:04:38.805 CMBT |
The typical log entry
""" """
import re import re
from base import Log, L_CMBT, Stacktrace from base import Log, L_CMBT, Stacktrace

View File

@ -4,6 +4,13 @@
from logs.base import Log, L_WARNING, Stacktrace from logs.base import Log, L_WARNING, Stacktrace
import re 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: Interesting Lines:
23:16:27.427 | Steam initialized appId 212070, userSteamID 1|1|4c5a01, userName 'G4bOrg' 23:16:27.427 | Steam initialized appId 212070, userSteamID 1|1|4c5a01, userName 'G4bOrg'