Maybe I haven’t looked hard enough, but I couldn't find a way for Notepad++ to handle a .LOG entry like the Windows Notepad does http://support.microsoft.com/kb/260563/en-us, so I wrote this:
Log.py
fromNppimport*importdatetimeBufferIDList=set()defupdateLog(args):editor.gotoLine(0)ifeditor.getCurLine().startswith(".LOG"):bid=notepad.getCurrentBufferID()ifbidnotinBufferIDList:BufferIDList.add(bid)editor.gotoLine(editor.getLineCount())editor.appendText("%s\n\n"%datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))editor.gotoLine(editor.getLineCount())editor.scrollCaret()defclearBufferIDList(args):try:BufferIDList.remove(args["bufferID"])exceptValueError:passnotepad.callback(clearBufferIDList,[NOTIFICATION.FILECLOSED])# Tried FILEOPENED before, but had problems with it (wrong buffer getting updated, not updated at all or delayed...).notepad.callback(updateLog,[NOTIFICATION.BUFFERACTIVATED])
startup.py
fromLogimportupdateLogupdateLog(0)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe I haven’t looked hard enough, but I couldn't find a way for Notepad++ to handle a .LOG entry like the Windows Notepad does http://support.microsoft.com/kb/260563/en-us, so I wrote this:
Log.py
startup.py