Logging Macros in 7.x

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
Quanti
Newbie
Posts: 3
Joined: Wed Feb 19, 2003 8:24 pm

Logging Macros in 7.x

Post by Quanti » Wed Feb 19, 2003 8:29 pm

Just upgraded to 7.x.

This involved changing the calling of macros to a full path to the macro instead of just the "name" of the macro.

How does MS know if and where to log the macro now? I still have the macro defined in MS itself with logging enabled, but unless I run the macro directly from MS, it is not logged.

Thanks.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Feb 21, 2003 4:10 pm

Hi,

This has been improved in the next maintenance release. A called macro will log to the log file of the calling macro - if it has one.

We have also added the ability to set a log file on the command line, so that when running script files from the command line a log file can be declared. Macros already set up with a log file in Macro Scheduler will already log when run from the command line using just the macro name. The new optional log file command line parameter will override this if specified and is useful for when running scripts not configured in Macro Scheduler.
MJT Net Support
[email protected]

Quanti
Newbie
Posts: 3
Joined: Wed Feb 19, 2003 8:24 pm

Post by Quanti » Fri Feb 21, 2003 4:18 pm

Ok, thanks.

You say the macro will be logged if called from the command line by "name". How about if the macro was called from another macro, with a full path? Will this still use the log configured in Macro Scheduler? Or will I have to specify the log file as an option in this case?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Feb 21, 2003 4:26 pm

Hi,

I obviously didn't explain myself very well. If a macro is called from another macro (whether a full path is specified or not) then the log file used will be the log file configured for the calling macro.

I.e. if Macro A calls Macro B using the Macro> command, and Macro A has a log file configured for it (whether in it's settings or given on the command line), Macro B will log out to Macro A's log file.
MJT Net Support
[email protected]

Quanti
Newbie
Posts: 3
Joined: Wed Feb 19, 2003 8:24 pm

Post by Quanti » Fri Feb 21, 2003 4:30 pm

Ah, that clears it up. Thanks.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Feb 21, 2003 4:30 pm

Oh and by the way - we've also added the ability to return values from the called macro to the calling macro.

The variable MACRO_RESULT is returned to the calling macro. So this can be set to whatever you like in the called macro and is transferred to the calling macro.
MJT Net Support
[email protected]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Feb 21, 2003 11:15 pm

Nice to finally have the called macro being logged.

But would it also be possible to have the log written under its own name vs. the calling macro name.

If multiple primary macros call a secondary macro, you could only check that the secondary ran by reviewing the logs of all the primary macros.

I am not asking not to include the log as part of the primary, but to actually write two logs, under the calling primary and under its own secondary name. This also allows the ability to retain appending logs if some primary macros overwrite logs and the called secondary macro appends logs.

Thanks for the tools!
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sat Feb 22, 2003 10:28 pm

Hi,

Yes, the /LOGFILE parameter can be used with the Macro> command as well as from the command line. So you could do:

Macro>SubMacroA /LOGFILE=c:\logs\mylog.txt

Without this it would log to the calling macro's log file if it had one.

This functionality will be in 7.1.18 which should be released in the next few days.
MJT Net Support
[email protected]

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Feb 22, 2003 11:59 pm

Such a deal! :D Thanks again for the great support.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts