Mercurial > traipse_dev
annotate orpg/tools/orpg_log.py @ 92:68c7bd272f27 beta
Traipse Beta 'OpenRPG' {090919-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:
Adds menu changes to draw attention to important updates, errors, or other events. (image info coming soon)
Traipse URL is not included in the repos tab and is set as default.
Fixes Copy for Windows and Linux (finally!!) users.
Fixes incomplete update to Grid and List nodes.
Fixes incomplete update to Chat Commands.
Fixes problems with Remote Image Upload.
Fixes Drop and Drag of Minis to Map.
CherryPy can now use any image in the webfiles/ folder and sub-folders.
CherryPy can now Drop and Drag Minis to the Map.
Minor changes to Update Manager's GUI.
Expert recommendation warning added to Revision Update.
Step down compatibility with open_rpg & component added to orpgCore.
Using majority of 'Grumpy' network folder to correct server lag.
author | sirebral |
---|---|
date | Sat, 19 Sep 2009 06:50:43 -0500 |
parents | 2fa8bd6785a5 |
children | 118fbe111922 |
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 ######################### | |
40 ORPG_CRITICAL = 1 | |
41 ORPG_GENERAL = 2 | |
42 ORPG_INFO = 4 | |
43 ORPG_NOTE = 8 | |
44 ORPG_DEBUG = 16 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
45 |
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
|
46 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
|
47 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
|
48 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
|
49 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
|
50 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
|
51 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
|
52 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
|
53 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
|
54 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
|
55 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
|
56 logger.info("Printed out crash-report.txt in your System folder", True) |
92 | 57 #component.get('frame').traipseSuite.SetTitle('&Traipse!!') |
58 component.get('frame').mainmenu.Replace(8, component.get('frame').traipseSuite, '&Traipse Suite!') | |
59 component.get('frame').debugConsole.SetBitmap(wx.Bitmap(dir_struct["icon"] + 'spotlight.png')) | |
60 component.get('frame').traipseSuite.RemoveItem(component.get('frame').debugConsole) | |
61 component.get('frame').traipseSuite.AppendItem(component.get('frame').debugConsole) | |
62 #wx.MessageBox('Crash Report Created!', 'System Failure') | |
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
|
63 |
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
|
64 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
|
65 def __init__(self, parent): |
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
|
66 super(DebugConsole, self).__init__(parent, -1, "Debug Window") |
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 icon = None |
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 icon = wx.Icon(dir_struct["icon"]+'note.ico', wx.BITMAP_TYPE_ICO) |
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
|
69 self.SetIcon( icon ) |
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 self.console = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE | wx.TE_READONLY) |
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
|
71 sizer = wx.BoxSizer(wx.VERTICAL) |
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 sizer.Add(self.console, 1, wx.EXPAND) |
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
|
73 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
|
74 self.SetAutoLayout(True) |
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
|
75 self.SetSize((300, 175)) |
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
|
76 self.Bind(wx.EVT_CLOSE, self.Min) |
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
|
77 self.Min(None) |
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
|
78 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
|
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
|
80 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
|
81 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
|
82 |
66 | 83 class orpgLog(object): |
84 _log_level = 7 | |
85 _log_name = None | |
86 _log_to_console = False | |
87 _io = TerminalWriter(sys.stderr) | |
88 _lvl_args = None | |
89 | |
90 def __new__(cls, *args, **kwargs): | |
91 it = cls.__dict__.get("__it__") | |
92 if it is not None: | |
93 return it | |
94 cls.__it__ = it = object.__new__(cls) | |
95 return it | |
96 | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
97 def __init__(self, home_dir, filename='orpgRunLog '): |
66 | 98 self._lvl_args = {16: {'colorizer': {'green': True}, |
99 'log_string': 'DEBUG'}, | |
100 8: {'colorizer': {'bold': True, 'green':True}, | |
101 'log_string':'NOTE'}, | |
102 4: {'colorizer': {'blue': True}, | |
103 'log_string': 'INFO'}, | |
104 2: {'colorizer': {'red': True}, | |
105 'log_string': 'ERROR'}, | |
106 1: {'colorizer': {'bold': True, 'red': True}, | |
107 'log_string': 'EXCEPTION'}} | |
108 if not self.log_name: | |
109 self.log_name = home_dir + filename + time.strftime('%m-%d-%Y.txt', | |
110 time.localtime(time.time())) | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
111 |
66 | 112 def debug(self, msg, to_console=False): |
113 self.log(msg, ORPG_DEBUG, to_console) | |
114 | |
115 def note(self, msg, to_console=False): | |
116 self.log(msg, ORPG_NOTE, to_console) | |
117 | |
118 def info(self, msg, to_console=False): | |
119 self.log(msg, ORPG_INFO, to_console) | |
120 | |
121 def general(self, msg, to_console=False): | |
122 self.log(msg, ORPG_GENERAL, to_console) | |
123 | |
124 def exception(self, msg, to_console=True): | |
125 self.log(msg, ORPG_CRITICAL, to_console) | |
126 | |
127 def log(self, msg, log_type, to_console=False): | |
128 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
|
129 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
|
130 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
|
131 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
|
132 except: pass |
66 | 133 |
134 if log_type & self.log_level or to_console: | |
135 atr = {'msg': msg, 'level': self._lvl_args[log_type]['log_string']} | |
136 atr['time'] = time.strftime('[%x %X]', time.localtime(time.time())) | |
137 logMsg = '%(time)s (%(level)s) - %(msg)s\n' % (atr) | |
138 | |
139 with open(self.log_name, 'a') as f: | |
140 f.write(logMsg) | |
141 | |
142 @pending_deprecation("use logger.log_level = #") | |
143 def setLogLevel(self, log_level): | |
144 self.log_level = log_level | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
145 |
66 | 146 @pending_deprecation("use logger.log_level") |
147 def getLogLevel(self): | |
148 return self.log_level | |
149 | |
150 @pending_deprecation("use logger.log_name = bla") | |
151 def setLogName(self, log_name): | |
152 self.log_name = log_name | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
153 |
66 | 154 @pending_deprecation("use logger.log_name") |
155 def getLogName(self): | |
156 return self.log_name | |
157 | |
158 @pending_deprecation("use logger.log_to_console = True/False") | |
159 def setLogToConsol(self, true_or_false): | |
160 self.log_to_consol = true_or_false | |
161 | |
162 @pending_deprecation("use logger.log_to_console") | |
163 def getLogToConsol(self): | |
164 return self.log_to_consol | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
165 |
66 | 166 """ |
167 Property Methods | |
168 """ | |
169 def _get_log_level(self): | |
170 return self._log_level | |
171 def _set_log_level(self, log_level): | |
172 if not isinstance(log_level, int) or log_level < 1 or log_level > 31: | |
173 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
|
174 |
66 | 175 self._log_level = log_level |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
176 |
66 | 177 def _get_log_name(self): |
178 return self._log_name | |
179 def _set_log_name(self, name): | |
180 if not os.access(os.path.abspath(os.path.dirname(name)), os.W_OK): | |
181 raise IOError("Could not write to the specified location") | |
182 | |
183 self._log_name = name | |
0
4385a7d0efd1
Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff
changeset
|
184 |
66 | 185 def _get_log_to_console(self): |
186 return self._log_to_console | |
187 def _set_log_to_console(self, true_or_false): | |
188 if not isinstance(true_or_false, bool): | |
189 raise TypeError("log_to_console must be a boolean value") | |
190 | |
191 self._log_to_console = true_or_false | |
192 | |
193 log_level = property(_get_log_level, _set_log_level) | |
194 log_name = property(_get_log_name, _set_log_name) | |
195 log_to_console = property(_get_log_to_console, _set_log_to_console) | |
196 | |
197 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
|
198 crash = sys.excepthook = Crash |