Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average. Display Modes
  #1  
Old 12-21-2004, 07:27 PM
gribble gribble is online now
Registered User
 
Join Date: 06-04-2003
Posts: 21
XML Logging

Hi, i decided to convert some of my existing build scripts over to use XML logging and an XML Transform step at the end to make it into a HTML document (just using the default xslt stylesheet).

What ive found though, is that when a compile failed, it had the following output:

code\sql\query.h(22) : error C2143: syntax error : missing ';' before '<class-head>'


This being on the log then caused the XML Transform step to fail because it thought the <class-head> was an XML tag when it was actually part of a step's output

Is there anyway i can fix this so i can use XML logging?


Also, is there any way to check/enforce that VBPro has it's log output in Application Options set to XML and not text... say if someone else was to run the buildscript, or on one of our build servers if it happened to be set to log as text not XML... it seems that the log output format should maybe be determined by a given script, and not as an application wide setting... because some scripts may require XML formatted logs while others may just email the raw logfile on completion (assuming it is plain readable text)
Reply With Quote
  #2  
Old 12-22-2004, 03:12 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
How is the text being written to the log file? VBP's XML logger will normally enclose step output in a CDATA section so that markup chars within it will not be treated as markup (for example, see the attached sample). Please post a stripped down sample which we can build that demonstrates the problem.

To set the log format to XML from your project (before the build starts), call

Application.Options.LogFormat = "XML"

from the project's vbld_BuildStarting script event.
Attached Files
File Type: bld logtest.bld (1.3 KB, 1685 views)
Reply With Quote
  #3  
Old 12-22-2004, 05:01 PM
gribble gribble is online now
Registered User
 
Join Date: 06-04-2003
Posts: 21
it's build output from a make visual studio 6 c++ project step

im not sure i can make an example without giving all the source code as well... basically there was an error in one of the c++ files in the the VC6 project and the error message was as above, containing the string <class-head> which is some sort of class or whatever in the c++ file


The XML Transform step at the end of the build gave an error saying that tag <class-head> was unmatched or something. Ill dig up the exact error and post it

Thanks for the tip on ensuring log format
Reply With Quote
  #4  
Old 12-22-2004, 06:20 PM
gribble gribble is online now
Registered User
 
Join Date: 06-04-2003
Posts: 21
The exact output and error message from the XML Log Transform step was:

Closing any open log tags...
Loading XML input document...
Error at line 698, position 3 loading 'C:\DOCUME~1\RYAN~1.GRI\LOCALS~1\Temp\bld4EBA.tmp' : End tag 'step' does not match the start tag 'class-head'.


Ive attached the logfile it was trying to transform (renamed to .txt). You can see that the output in question is inside CDATA attribute
Attached Files
File Type: txt vstudio.txt (23.5 KB, 1964 views)

Last edited by gribble; 12-22-2004 at 06:24 PM.
Reply With Quote
  #5  
Old 12-22-2004, 06:29 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Looking at the log, it appears that you have a Write File action that is writing to the log file (see line 550, column 35). The Write File action simply opens the specified file and appends whatever text is supplied, and if the log file is XML, that isn't going to work. If you want that output in the log file, use a Log Message action rather than a Write File action.
Reply With Quote
  #6  
Old 12-22-2004, 06:30 PM
gribble gribble is online now
Registered User
 
Join Date: 06-04-2003
Posts: 21
i just realised that myself!! Converting over to using XML format, seems i missed the WriteFile step that's in the failure steps... should have used a Log Message

Thanks for the help
Reply With Quote
Reply


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 12:45 PM.


Copyright © 1999-2023 Kinook Software, Inc.