[Pydev-cvs] org.python.pydev.core/src/org/python/pydev/core/log Log.java, 1.9, 1.10
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-09-27 19:57:53
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/log In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19948/src/org/python/pydev/core/log Modified Files: Log.java Log Message: Synching to latest changes: Pydev <ul> <li><strong>Editor</strong>: Cursor settings no longer overridden</li> <li><strong>Code-completion</strong>: If __all__ is defined with runtime elements (and not only in a single assign statement), it's ignored for code-completion purposes</li> <li><strong>Debugger</strong>: Pythonpath the same in debug and regular modes (sys.path[0] is the same directory as the file run)</li> <li><strong>Debugger</strong>: Persist choices done in the debugger when files from the debugger are not found</li> <li><strong>Interpreter config</strong>: "email" automatically added to the "forced builtins"</li> <li><strong>Parser</strong>: Correctly recognizing absolute import with 3 or more levels</li> <li><strong>Syntax check</strong>: Option to do only on active editor</li> </ul> Also: tabs changed for spaces Index: Log.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/log/Log.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Log.java 9 Aug 2007 01:31:28 -0000 1.9 --- Log.java 27 Sep 2008 19:57:34 -0000 1.10 *************** *** 31,36 **** try { ! Status s = new Status(errorLevel, CorePlugin.getPluginID(), errorLevel, message, e); ! CorePlugin.getDefault().getLog().log(s); } catch (Exception e1) { //logging should not fail! --- 31,36 ---- try { ! Status s = new Status(errorLevel, CorePlugin.getPluginID(), errorLevel, message, e); ! CorePlugin.getDefault().getLog().log(s); } catch (Exception e1) { //logging should not fail! *************** *** 54,71 **** public synchronized static void toLogFile(Object obj, String string) { synchronized(lock){ ! Class<? extends Object> class1 = obj.getClass(); toLogFile(string, class1); } } ! public static void toLogFile(String string, Class<? extends Object> class1) { ! StringBuffer buffer = new StringBuffer(); ! buffer.append(logIndent); ! buffer.append(FullRepIterable.getLastPart(class1.getName())); ! buffer.append(": "); ! buffer.append(string); ! ! toLogFile(buffer.toString()); ! } private synchronized static void toLogFile(String buffer) { --- 54,71 ---- public synchronized static void toLogFile(Object obj, String string) { synchronized(lock){ ! Class<? extends Object> class1 = obj.getClass(); toLogFile(string, class1); } } ! public static void toLogFile(String string, Class<? extends Object> class1) { ! StringBuffer buffer = new StringBuffer(); ! buffer.append(logIndent); ! buffer.append(FullRepIterable.getLastPart(class1.getName())); ! buffer.append(": "); ! buffer.append(string); ! ! toLogFile(buffer.toString()); ! } private synchronized static void toLogFile(String buffer) { *************** *** 74,82 **** CorePlugin default1 = CorePlugin.getDefault(); if(default1 == null){ ! //in tests ! System.out.println(buffer); ! return; } ! IPath stateLocation = default1.getStateLocation().append("PydevLog.log"); String file = stateLocation.toOSString(); REF.appendStrToFile(buffer+"\r\n", file); --- 74,82 ---- CorePlugin default1 = CorePlugin.getDefault(); if(default1 == null){ ! //in tests ! System.out.println(buffer); ! return; } ! IPath stateLocation = default1.getStateLocation().append("PydevLog.log"); String file = stateLocation.toOSString(); REF.appendStrToFile(buffer+"\r\n", file); *************** *** 88,103 **** public static void toLogFile(Exception e) { ! String msg = getExceptionStr(e); ! toLogFile(msg); } ! public static String getExceptionStr(Exception e) { ! final ByteArrayOutputStream str = new ByteArrayOutputStream(); ! final PrintStream prnt = new PrintStream(str); ! e.printStackTrace(prnt); ! prnt.flush(); ! String msg = new String(str.toByteArray()); ! return msg; ! } public synchronized static void addLogLevel() { --- 88,103 ---- public static void toLogFile(Exception e) { ! String msg = getExceptionStr(e); ! toLogFile(msg); } ! public static String getExceptionStr(Exception e) { ! final ByteArrayOutputStream str = new ByteArrayOutputStream(); ! final PrintStream prnt = new PrintStream(str); ! e.printStackTrace(prnt); ! prnt.flush(); ! String msg = new String(str.toByteArray()); ! return msg; ! } public synchronized static void addLogLevel() { |