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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Write log file

Sekar1
12-Amethyst

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
remy
21-Topaz I
(To:Sekar1)

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
remy
21-Topaz I
(To:Sekar1)

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().

Top Tags