Menu

Compile Logs into Text File

Jason
2018-01-18
2024-10-21
  • Jason

    Jason - 2018-01-18

    Hello guys,

    I need to edit the source code of DEV C++ in order for the "compile logs" (if the compilation is successful or not, line of error, etc) to be output into a text file.
    I am using Delphi 7 to compile & run the program and it is working fine.

    Now, I need help on how to output the compile logs into a text file with my custom format (if possible)
    This is my first time programming in Delphi.

    Thanks.

     
  • vithka8

    vithka8 - 2023-11-30

    To redirect the compile logs from DEV C++ to a text file with your custom format, you can follow these steps:

    Create a text file: Create a new text file named "compile_logs.txt" in the same directory as your DEV C++ project files.

    Modify the project settings: Open the project settings in DEV C++ and navigate to the "Compiler" options. Under the "Output" section, enable the "Redirect output to file" option and specify the "compile_logs.txt" file as the output destination.

    Customize the output format: To customize the output format, you can insert custom text or variables into the output string using the following format:

    %f - Filename
    %l - Line number
    %e - Error message
    %w - Warning message
    %s - Status (success/failure)
    

    For example, to output the filename, line number, and error message, you can use the following format:

    %f (%l): %e
    

    Compile the project: Compile the project in DEV C++. The compile logs will now be redirected to the "compile_logs.txt" file with your custom format.
    Here's an example of how to use the custom format to output the filename, line number, error message, and status:

    %f (%l): %e%n%s
    

    This will output the following information for each error:

    Filename (line number): Error message
    Status: Failure
    

    You can further customize the output format by adding additional text or variables as needed.

     
  • wegocup

    wegocup - 2025-01-30
    Post awaiting moderation.

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.