After I and @rdipardo had both separately confirmed that MS notepad.exe really does have that feature, I decided it was worth the effort to write the script, even if the original poster never comes back to ask for it.
Installation instructions
see full instructions in our FAQhttps://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript save the script below as DotLogTimestamp.py in the PythonScript user-scripts directory (usually %AppData%\Notepad++\Plugins\Config\PythonScript\Scripts\) if you want this feature active every time you run Notepad++: Plugins > Python Script > Configuration: set Initialisation to ATSTARTUP As the FAQ mentions, add the following lines to the user startup.py import DotLogTimestamp _DLTS = DotLogTimestamp.DLTS() script: DotLogTimestamp.py # encoding=utf-8 """in response to https://community.notepad-plus-plus.org/topic/24650/ - Call this from startup.py using import DotLogTimestamp _DLTS = DotLogTimestamp.DLTS() - Make sure to set Plugins > PythonScript > Configuration > Initialisation to "ATSTARTUP" instead of "LAZY" - installation instructions: see https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript """ from Npp import editor,notepad,console,NOTIFICATION from datetime import datetime class DLTS(object): def __init__(self): console.write("Registered DotLogTimestamp.py callbacks\n") notepad.callback(self.fileopened_callback, [NOTIFICATION.FILEOPENED]) notepad.callback(self.bufferactivated_callback, [NOTIFICATION.BUFFERACTIVATED]) self.active = True self.bufferIDs = [] def toggle(self): self.active = not self.active console.write("DotLogTimestamp.py callbacks are {}\n".format('active' if self.active else 'inactive')) def fileopened_callback(self, args): if self.active: self.bufferIDs.append(args['bufferID']) def bufferactivated_callback(self, args): if self.active: if args['bufferID'] in self.bufferIDs: line = editor.getLine(0).strip() if line[0:4] == ".LOG": editor.appendText("{}\n".format(datetime.now().strftime("%Y-%b-%d %H:%M:%S"))) self.bufferIDs.remove(args['bufferID']) if __name__ == '__main__': try: _DLTS.toggle() except NameError: _DLTS = DLTS()