cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Write log file

SOLVED
Highlighted
Garnet

Write log file

Hi,

 

Some one please suggest me the methods/steps to write log file in a creo parametric toolkit application.

 

I tried using PTApplsUnicodeFopen() but when i try to add header file PTApplsUnicodeUtils.h gives unresolved external error.

 

Please tell me the how to write a log file in creo parametric toolkit application

 

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Write log file

There are multiple ways to write a log file in your application.

The most straightforward consists in writing in a file.

If you code with C:

//create a global variable:
FILE *log;

//open the file (when needed):
log = fopen("your_log_file_name.log", "w");

//From your function(s), call fprintf() to write stuff in your file when required:
fprintf(log, "%d %s\n", <my_integer>, <my_string>);

//when closing to the end of your application, close the file:
fclose(log);

 

An alternative consists in writing stuff in the trail file.

To perform that, rely on ProTrailfileCommentWrite().

View solution in original post

1 REPLY 1

Re: Write log file

There are multiple ways to write a log file in your application.

The most straightforward consists in writing in a file.

If you code with C:

//create a global variable:
FILE *log;

//open the file (when needed):
log = fopen("your_log_file_name.log", "w");

//From your function(s), call fprintf() to write stuff in your file when required:
fprintf(log, "%d %s\n", <my_integer>, <my_string>);

//when closing to the end of your application, close the file:
fclose(log);

 

An alternative consists in writing stuff in the trail file.

To perform that, rely on ProTrailfileCommentWrite().

View solution in original post

Announcements