Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-06-2003, 06:44 PM
levelinfinity levelinfinity is offline
Registered User
 
Join Date: 10-28-2002
Posts: 1
Creating logfiles

Hello everyone.
Is there a way to assign the date & time to the
logfile name when doing builds?

I tried adding the macro DATETIME to the logfile name and it doesn't create the log file. For example the variable BUILD_DATETIME is set to %DATETIME%. The LOGFILE variable is set to %PROJDIR%\Results_%BUILD_DATETIME%.log. If I set the LOGFILE variable to %PROJDIR%\Results.log it creates the logfile Results.log.

I want to be able to differentiate between log files.
Date and Time seemed appropriate.

Warren
Reply With Quote
  #2  
Old 03-06-2003, 06:47 PM
schmidt4hire schmidt4hire is online now
Registered User
 
Join Date: 12-17-2002
Posts: 2
Warren, the %DATETIME% macro is expanding to include invalid filename characters.

If your example was run today at 1:25:42 PM, and %PROJDIR% evalulated to "C:\MyProject", the log filename would evaluate to "C:\MyProject\Results_1/7/2003 1:25:42 PM". The forward slashes (/) between the day/month/year and the colons (:) between the hour:minutes:seconds are all invalid filename characters.

When this happens, VBuild is likely getting a error when it tries to create the logfile and just forcibly continues, without any logging.

Try changing your project so that it automatically creates the BUILD_DATETIME macro as one of the first steps, and then set its value to something like this (using the square-bracket notation to run some VBScript code):
[ Year( Now ) & "_" & _
Month( Now ) & "_" & _
Day( Now ) & "_" & _
Hour( Now ) & "_" & _
Minute( Now ) ]

This would give your filename the value of "C:\MyProject\Results_2003_1_7_13_44". Granted, this is kinda gross, but it will work. You can fiddle more with VBScript if you want a better formatted filename. I couldn't see an easy way to format a number with leading zeroes.

Cheers,
Doug

Creo
Doug Schmidt | Software Developer (Inkjet MDA) | Tel: +1.604.451.2720 ext: 3190 | <mailto:doug.schmidt@creo.com> | www.creo.com
IMAGINE CREATE BELIEVE
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 06:54 AM.


Copyright © 1999-2023 Kinook Software, Inc.