
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
extendscript_log
Advanced tools
A log constructor for Adobe ExtendScript with optional log file, and broadcasts to CEP panels with "ExtendScript_Log" events. UMD wrapper for cross-compatability with AMD and node.js require.
An ExtendScript compatible log constructor object with shims for basic Console calls, log file, and custom "ExtendScript_Log" events sent to CEP panels.
Trying to split the difference between too-basic and OMG-features-and-dependencies.
$.global)JSON.stringify() via whatever library you care to includenew ExternalObject("lib:\PlugPlugExternalObject")If running Node NPM, you can npm install ExtendScript_Log to add to your node_modules folder
Clone or download the repo and copy the ExtendScript_Log.jsxinc to your project
var extlog = require("ExtendScript_Log");
I don't know but it's probably not difficult? Firmly in the untested-but-should-work category
$.evalFile("<path>/ExtendScript_Log.jsxinc")
//@include "<path>/ExtendScript_Log.jsxinc"
Add to a build script or, I dunno, just copy-pasta it in there?
Default log levels are:
make a new log and you get a separate instance
var myLog = new ExtendScript_Log();
myLog.log('Hey there.');
var specialLog = new ExtendScript_Log(null,"special");
specialLog.log('Salutations.');
myLog.warn('Special log thinks they're all that...');
specialLog.info('Default log is jealous cause I have a label.');
// prints:
// Hey there.
// SPECIAL:Salutations.
// [WARN] Special log thinks they're all that...
// SPECIAL:[INFO] Default log is jealous of my label.
"new" constructor takes 6 optional arguments. First arg is an alternate root object to tack on a 'log' and 'console' alias By passing $.global as first arg, we get global log and console objects!
root = $.global;// root to add convenience alisases to
logName = "specialLog";// name other than "defualt"
logLevel = 2;// log level filter
useLogFile = true;// make a log file? Deafults to false. (see Bonus Features)
keepOldLogs = false;// keep or delete all but latest log file?
logFileDir = undefined;// a string filepath to save logs to.
myLog = new ExtendScript_Log(root, logName, logLevel, useLogFile, keepOldLogs, logFileDir);
Log.log (message, useAlert);// standard use
// send custom level/label; doesn't work with Log.info() etc.
Log.log (message, level, label, useAlert);
myLog = new ExtendScript_Log($.global);
console.log('Messages are good.');
console.info('So informative...');
log.warn('Duck!');
log.error('Not a good thing');
mySecretLog = new ExtendScript_Log(null, "secret");
mySecretLog.warn('Tell no one...');
// prints:
// Messages are good.
// [INFO] So informative...
// [WARN] Duck!
// [ERROR] Not a good thing
// SECRET:[WARN] Tell no one...
Second argument sends up an blocking alert dialog in app if true
log.error('Not a good thing', true);
Tries to make a log file in ./logs or to ~/Desktop/ExtendScript_Log_UnsavedScripts/ or you can specify a custom log folder path as the 6th argument. Needs ExtendScript_LogFile, but will make a new log file automatically if that has been included.
Note: Different logs get different log files, even if they all print to the same console.
Tries to send type, level, label, and message as a packet in a custom event "ExtendScript_Log"
No JSON support needed in the script to send, but you have to un-strigify on receipt:
data string looks like: {type: "default", level:2, label:"info", message:"Important things!"}
Note: the "clear()" function sends a packet with "clear" label and log level 99.
// add a custom log level
Log.addLogLevel("gui",3);
Log.gui('Making dialog');
FAQs
A log constructor for Adobe ExtendScript with optional log file, and broadcasts to CEP panels with "ExtendScript_Log" events. UMD wrapper for cross-compatability with AMD and node.js require.
We found that extendscript_log demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.