LogCommand - a wrapper for dopus commands to give you extended and persistent information about what has been done and when - in multiple daily logfiles.
Did you ever deleted something by accident or do you sometimes forget where you copied your last backup? o) Then this might be for you. The reason I did this is because the current undo-log does not give a hint on what files were affected by the last operation (if it were many) and it was last week I lost several hours of work by that fact. The current undo tells you: "You deleted 600 files there." But there's no way to look at these files, keep this information for later use or re-run an operation for items that failed (the re-run part needs manual work, this is no replacement for the builtin undo, but you have the option at least).
Featues and requirements:
- works for nearly all commands related to files and folders
- optional "friendly-log" to console
- persistent logging to automatically created folders and files
- logging of failed items
- passing through of parameters and qualifiers
- creates csv-data to easily inspect and reuse for heavy undo/redo operations e.g.
- easy to use (I think)
Usage:
LogCommand has two important parameters, COMMAND
and PARAMS
. In case you'd like to log what files you delete and your standard delete command is:
Delete NoRecycle
Edit that command (if it's a hotkey, button, menu, file type context etc. does not matter) like that:
LogCommand COMMAND=Delete PARAMS=NoRecycle
Setup the log directory in the commands script config section or leave it as it is (it defaults to <dopus installation folder>\logs\yyyyy_mm_dd
).
Delete something and watch the log directory for what happened.
Here is another usage demonstration on the copy command, to really make effective use of the log-wrapper it is necessary to edit ALL command like that.
I suggest doing so for all delete buttons/hotkeys and menu-items, if you'd like to log copy/move and clipboard operations as well it takes 10 minutes more to get these changed as well. I did and I hope to be on the safe side now.
To open the currently valid logfile directory use the GoLogs
switch:
LogCommand GOLOGS
Parameters in detail:
-
Command
, any command to wrap around and log -
LogName
, an optional name for the logfile (useful for a command like "Copy Move" to result in a logfile calledyyyyy_mm_dd_Move_.log.csv
-
LogToFolder
, enable disable logging to the logfolder -
LogToConsole
, enable disable logging to script console -
LogFailedItems
, enable disable logging of failed items (skipped/aborted/failed items when deleting/moving etc.) -
ID
, a custom identifier to separate log entries if desired -
GoLogs
, a switch to open the current folder with logfiles -
Params
, optional but always needs to be the last parameter, as everything after will be used as params for the actual command to run
Friendly, shorthand console output:
Script command config section:
Any hints to improve this are greatly appreciated! I hope it saves your *ss next time! o) In case anybody needs a logger for doing heavier scripting in DO, the script contains a logging "class" supporting different levels, append/overwrite, parallel console output, works outside of DO as well and the best thing is, it supports indents and it can serialize output to dopus console to prevent "log-trashing" if you're using dopus events and all these fire at the same time. Should give this a dedicated thread maybe. All for now, cya! o)
Installation:
To install the command, download the *.js.txt file below and drag it to Preferences / Toolbars / Scripts.
After that edit as much buttons/menu entries and hotkeys as possible and wrap any delete/move/copy operation with LogCommand
.
Download:
-
Latest: v0.4.2 detection for "clipboard paste" commands, to log items affected from clipboard instead of current file display:
Command.Generic_LogCommand.js.txt (12.5 KB) -
v0.4.1 visually enhanced debug output for dopus team:
Command.Generic_LogCommand.js.txt (12.1 KB) -
v0.4 added switch "GoLogs" to have the current log folder opened, csv-data may contain ";" now:
Command.Generic_LogCommand.js.txt (12 KB) -
v0.3 initial release:
Command.Generic_LogCommand.js.txt (11.9 KB)