Hi Jason - I've used something similar to this in the past, if I was looking for something quick and simple:
from com.ibm.tivoli.maximo.script import ScriptService
service = ScriptService("MVN.LOGGING.TEST", None, None)
# Variable to hold log message.
logs = []
def addLog(s):
# Set as String, so we don't get weird conversion errors.
logs.append(str(s))
def showLog():
# Use service varaible to raise exception.
service.error("error", "\n".join(logs))
# Add logs.
addLog("First log message here.")
addLog("Second different message.")
addLog("Last message.")
# Show error now.
showLog()
You should be able to call addLog to capture your messages in the script, and then at the end of the script, call showLog(), which just raises an exception to stop the script, but you should have visibility to the logs that were added during the execution.
I hope this helps!
------------------------------
Aaron Paroulek
Maven Asset Management
------------------------------
Original Message:
Sent: 04-02-2025 09:18
From: Jason Johnson
Subject: Script Debugging
Yes, that's the format I am using. While it is useful for showing some data, it still stops execution.
------------------------------
Jason Johnson
RSI
Original Message:
Sent: 04-02-2025 06:57
From: Poonam Aswani
Subject: Script Debugging
hello,
have you tried to use these?
errorgroup='messageid'
errorkey='messagekey'
------------------------------
Poonam Aswani
ltimindtree
Original Message:
Sent: 04-01-2025 07:30
From: Jason Johnson
Subject: Script Debugging
We are in a SaaS environment with no direct access to logs. Are there other methods to debug? Looking for something as simple as a message box. I've tried using service.error, but that halts execution of the rest of the script.
#Administration
------------------------------
Jason Johnson
RSI
------------------------------