some commenting for clearness.
This commit is contained in:
parent
62edcc0a77
commit
25d0e7217e
22
logs/base.py
22
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):
|
||||
|
@ -2,9 +2,13 @@
|
||||
from logs.base import Log, L_WARNING, Stacktrace
|
||||
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
|
||||
|
||||
"""
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user