Mercurial > traipse_dev
annotate orpg/tools/orpg_log.py @ 121:496dbf12a6cb alpha
Traipse Alpha 'OpenRPG' {091030-00}
Traipse is a distribution of OpenRPG that is designed to be easy to setup and go.
Traipse also makes it easy for developers to work on code without fear of
sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the
code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the
productivity of the user.
Update Summary (Cleaning up for Beta):
Adds Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images!
Changes made to the map for increased portability. SnowDog has changes planned in
Core, though.
Added an initial push to the BCG. Not much to see, just shows off how it is
re-writing Main code.
Fix to remote admin commands
Minor fix to texted based server, works in /System/ folder
Some Core changes to gametree to correctly disply Pretty Print, thanks David!
Fix to Splitter Nodes not being created.
Added images to Plugin Control panel for Autostart feature
Fix to massive amounts of images loading; from Core
fix to gsclient so with_statement imports
Added 'boot' command to remote admin
Prep work in Pass tool for remote admin rankings and different passwords, ei,
Server, Admin, Moderator, etc.
Remote Admin Commands more organized, more prep work.
Added Confirmation window for sent nodes.
Minor changes to allow for portability to an OpenSUSE linux OS (hopefully without
breaking)
{091028}
Made changes to gametree to start working with Element Tree, mostly from Core
Minor changes to Map to start working with Element Tree, from Core
Preliminary changes to map efficiency, from FlexiRPG
Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG
Changes to main.py to start working with Element Tree
{091029}
Changes made to server to start working with Element Tree.
Changes made to Meta Server Lib. Prepping test work for a multi meta network
page.
Minor bug fixed with mini to gametree
Zoom Mouse plugin added.
{091030}
Getting ready for Beta. Server needs debugging so Alpha remains bugged.
Plugin UI code cleaned. Auto start works with a graphic, pop-up asks to enable or
disable plugin.
Update Manager now has a partially working Status Bar. Status Bar captures
terminal text, so Merc out put is visible. Manifest.xml file, will be renamed, is
now much cleaner.
Debug Console has a clear button and a Report Bug button. Prep work for a Term2Win
class in Debug Console.
Known: Current Alpha fails in Windows.
author | sirebral |
---|---|
date | Fri, 30 Oct 2009 22:21:40 -0500 |
parents | af6bf998f425 |
children | 36919b8a3ef9 |
rev | line source |
---|---|
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
1 # Copyright (C) 2000-2001 The OpenRPG Project |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
2 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
3 # openrpg-dev@lists.sourceforge.net |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
4 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
5 # This program is free software; you can redistribute it and/or modify |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
6 # it under the terms of the GNU General Public License as published by |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
7 # the Free Software Foundation; either version 2 of the License, or |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
8 # (at your option) any later version. |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
9 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
10 # This program is distributed in the hope that it will be useful, |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
13 # GNU General Public License for more details. |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
14 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
15 # You should have received a copy of the GNU General Public License |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
16 # along with this program; if not, write to the Free Software |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
18 # -- |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
19 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
20 # File: orpg_log.py |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
21 # Author: Dj Gilcrease |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
22 # Maintainer: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
23 # Version: |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
24 # $Id: orpg_log.py,v 1.9 2007/05/06 16:43:02 digitalxero Exp $ |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
25 # |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
26 # Description: classes for orpg log messages |
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
27 # |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
28 |
66 | 29 from __future__ import with_statement |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
30 import sys, os, os.path, wx, time, traceback |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
31 |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
32 from orpg.orpgCore import component |
66 | 33 from orpg.external.terminalwriter import TerminalWriter |
34 from orpg.tools.decorators import pending_deprecation | |
35 from orpg.dirpath import dir_struct | |
36 | |
37 ######################### | |
38 ## Error Types | |
39 ######################### | |
121 | 40 ORPG_PRINT = 0 |
66 | 41 ORPG_CRITICAL = 1 |
42 ORPG_GENERAL = 2 | |
43 ORPG_INFO = 4 | |
44 ORPG_NOTE = 8 | |
45 ORPG_DEBUG = 16 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
46 |
121 | 47 |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
48 def Crash(type, value, crash): |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
49 crash_report = open(dir_struct["home"] + 'crash-report.txt', "w") |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
50 traceback.print_exception(type, value, crash, file=crash_report) |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
51 crash_report.close() |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
52 msg = '' |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
53 crash_report = open(dir_struct["home"] + 'crash-report.txt', "r") |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
54 for line in crash_report: msg += line |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
55 logger.exception(msg) |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
56 crash_report.close() |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
57 logger.exception("Crash Report Created!!") |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
79
diff
changeset
|
58 logger.info("Printed out crash-report.txt in your System folder", True) |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
59 |
121 | 60 class Term2Win(object): |
61 # A stdout redirector. Allows the messages from Mercurial to be seen in the Install Window | |
62 def write(self, text): | |
63 #logger.stdout(text) | |
64 wx.Yield() | |
65 #sys.__stdout__.write(text) | |
66 | |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
67 class DebugConsole(wx.Frame): |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
68 def __init__(self, parent): |
95 | 69 super(DebugConsole, self).__init__(parent, -1, "Debug Console") |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
70 icon = wx.Icon(dir_struct["icon"]+'note.ico', wx.BITMAP_TYPE_ICO) |
121 | 71 self.SetIcon(icon) |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
72 self.console = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE | wx.TE_READONLY) |
121 | 73 self.bt_clear = wx.Button(self, wx.ID_CLEAR) |
74 self.report = wx.Button(self, wx.ID_ANY, 'Bug Report') | |
75 sizer = wx.GridBagSizer(hgap=1, vgap=1) | |
76 sizer.Add(self.console, (0,0), span=(1,2), flag=wx.EXPAND) | |
77 sizer.Add(self.bt_clear, (1,0), flag=wx.ALIGN_LEFT) | |
78 sizer.Add(self.report, (1,1), flag=wx.ALIGN_LEFT) | |
79 sizer.AddGrowableCol(0) | |
80 sizer.AddGrowableRow(0) | |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
81 self.SetSizer(sizer) |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
82 self.SetAutoLayout(True) |
121 | 83 self.SetSize((450, 175)) |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
84 self.Bind(wx.EVT_CLOSE, self.Min) |
121 | 85 self.Bind(wx.EVT_BUTTON, self.clear, self.bt_clear) |
86 self.Bind(wx.EVT_BUTTON, self.bug_report, self.report) | |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
87 self.Min(None) |
121 | 88 sys.stdout = Term2Win() |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
89 component.add('debugger', self.console) |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
90 |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
91 def Min(self, evt): |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
92 self.Hide() |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
93 |
121 | 94 def clear(self, evt): |
95 self.console.SetValue('') | |
96 | |
97 def bug_report(self, evt): | |
98 pass | |
99 | |
66 | 100 class orpgLog(object): |
101 _log_level = 7 | |
102 _log_name = None | |
103 _log_to_console = False | |
104 _io = TerminalWriter(sys.stderr) | |
105 _lvl_args = None | |
106 | |
107 def __new__(cls, *args, **kwargs): | |
108 it = cls.__dict__.get("__it__") | |
109 if it is not None: | |
110 return it | |
111 cls.__it__ = it = object.__new__(cls) | |
112 return it | |
113 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
114 def __init__(self, home_dir, filename='orpgRunLog '): |
66 | 115 self._lvl_args = {16: {'colorizer': {'green': True}, |
116 'log_string': 'DEBUG'}, | |
117 8: {'colorizer': {'bold': True, 'green':True}, | |
118 'log_string':'NOTE'}, | |
119 4: {'colorizer': {'blue': True}, | |
120 'log_string': 'INFO'}, | |
121 2: {'colorizer': {'red': True}, | |
122 'log_string': 'ERROR'}, | |
123 1: {'colorizer': {'bold': True, 'red': True}, | |
124 'log_string': 'EXCEPTION'}} | |
125 if not self.log_name: | |
126 self.log_name = home_dir + filename + time.strftime('%m-%d-%Y.txt', | |
127 time.localtime(time.time())) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
128 |
66 | 129 def debug(self, msg, to_console=False): |
130 self.log(msg, ORPG_DEBUG, to_console) | |
131 | |
132 def note(self, msg, to_console=False): | |
133 self.log(msg, ORPG_NOTE, to_console) | |
134 | |
135 def info(self, msg, to_console=False): | |
136 self.log(msg, ORPG_INFO, to_console) | |
137 | |
138 def general(self, msg, to_console=False): | |
139 self.log(msg, ORPG_GENERAL, to_console) | |
140 | |
141 def exception(self, msg, to_console=True): | |
95 | 142 ### Beta ### Every 'Critical' exception will draw attention to the Debug Console |
143 component.get('frame').TraipseSuiteWarn('debug') | |
66 | 144 self.log(msg, ORPG_CRITICAL, to_console) |
145 | |
146 def log(self, msg, log_type, to_console=False): | |
147 if self.log_to_console or to_console or log_type == ORPG_CRITICAL: | |
82
2fa8bd6785a5
TerminalWriter's colors are nice, but if no debug console is open it causes the software to look for one until a recursion error is created. Crash reports are sent to the debug console and a pop-up tells the user one has happened. Fix to chat window from SnowDog.
sirebral
parents:
81
diff
changeset
|
148 try: self._io.line(str(msg), **self._lvl_args[log_type]['colorizer']) |
2fa8bd6785a5
TerminalWriter's colors are nice, but if no debug console is open it causes the software to look for one until a recursion error is created. Crash reports are sent to the debug console and a pop-up tells the user one has happened. Fix to chat window from SnowDog.
sirebral
parents:
81
diff
changeset
|
149 except: pass #Fails without the Debug Console |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
150 try: component.get('debugger').AppendText(".. " + str(msg) +'\n') |
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
151 except: pass |
66 | 152 |
153 if log_type & self.log_level or to_console: | |
154 atr = {'msg': msg, 'level': self._lvl_args[log_type]['log_string']} | |
155 atr['time'] = time.strftime('[%x %X]', time.localtime(time.time())) | |
156 logMsg = '%(time)s (%(level)s) - %(msg)s\n' % (atr) | |
157 | |
158 with open(self.log_name, 'a') as f: | |
159 f.write(logMsg) | |
160 | |
161 @pending_deprecation("use logger.log_level = #") | |
162 def setLogLevel(self, log_level): | |
163 self.log_level = log_level | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
164 |
66 | 165 @pending_deprecation("use logger.log_level") |
166 def getLogLevel(self): | |
167 return self.log_level | |
168 | |
169 @pending_deprecation("use logger.log_name = bla") | |
170 def setLogName(self, log_name): | |
171 self.log_name = log_name | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
172 |
66 | 173 @pending_deprecation("use logger.log_name") |
174 def getLogName(self): | |
175 return self.log_name | |
176 | |
177 @pending_deprecation("use logger.log_to_console = True/False") | |
178 def setLogToConsol(self, true_or_false): | |
179 self.log_to_consol = true_or_false | |
180 | |
181 @pending_deprecation("use logger.log_to_console") | |
182 def getLogToConsol(self): | |
183 return self.log_to_consol | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
184 |
66 | 185 """ |
186 Property Methods | |
187 """ | |
188 def _get_log_level(self): | |
189 return self._log_level | |
190 def _set_log_level(self, log_level): | |
191 if not isinstance(log_level, int) or log_level < 1 or log_level > 31: | |
192 raise TypeError("The loggers level must be an int between 1 and 31") | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
193 |
66 | 194 self._log_level = log_level |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
195 |
66 | 196 def _get_log_name(self): |
197 return self._log_name | |
198 def _set_log_name(self, name): | |
199 if not os.access(os.path.abspath(os.path.dirname(name)), os.W_OK): | |
200 raise IOError("Could not write to the specified location") | |
201 | |
202 self._log_name = name | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
203 |
66 | 204 def _get_log_to_console(self): |
205 return self._log_to_console | |
206 def _set_log_to_console(self, true_or_false): | |
207 if not isinstance(true_or_false, bool): | |
208 raise TypeError("log_to_console must be a boolean value") | |
209 | |
210 self._log_to_console = true_or_false | |
211 | |
212 log_level = property(_get_log_level, _set_log_level) | |
213 log_name = property(_get_log_name, _set_log_name) | |
214 log_to_console = property(_get_log_to_console, _set_log_to_console) | |
215 | |
216 logger = orpgLog(dir_struct.get("user") + "runlogs/") | |
79
dd4be4817377
Chat Window no longer prints excessive debug statements to console. Renamed the Update Manager menu item to Traipse Suite. Added debug console to Traipse Suite. Log now prints an error report and waits for user input so Windows users can see the error being reported.
sirebral
parents:
66
diff
changeset
|
217 crash = sys.excepthook = Crash |