Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEBUG log level to export debug files #38

Merged
merged 3 commits into from
Nov 23, 2023

Conversation

p-arvy
Copy link
Member

@p-arvy p-arvy commented Oct 30, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

Fix #20.

What kind of change does this PR introduce?

The debug files are exported if ampl log level is in DEBUG mode

What is the current behavior?

One debug file is exported at the end of every run. Another is exported only if conditional clause is removed by user in ampl code.

What is the new behavior (if this is a feature change)?
The two debug files are exported if the ampl log level specified by user is DEBUG

Does this PR introduce a breaking change or deprecate an API?

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

Signed-off-by: parvy <pierre.arvy@artelys.com>
@p-arvy p-arvy requested a review from klorel October 30, 2023 17:06
@p-arvy p-arvy self-assigned this Oct 30, 2023
@p-arvy p-arvy changed the title Add debug log level to export debug files DEBUG log level to export debug files Oct 30, 2023
@p-arvy p-arvy changed the title DEBUG log level to export debug files [WIP] DEBUG log level to export debug files Nov 10, 2023
@p-arvy p-arvy changed the title [WIP] DEBUG log level to export debug files DEBUG log level to export debug files Nov 15, 2023
@p-arvy p-arvy added the AMPL label Nov 16, 2023
unit_Q0[1,g,n],
unit_id[1,g,n],
bus_id[1,n]
> (fileOut);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use >> to append lines in the file

unit_id[1,g,n],
bus_id[1,n]
> (fileOut);
printf{LOG_DEBUG} "#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW);id;bus_id;\n" > (fileOut);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close the file before, the first printf

Signed-off-by: parvy <pierre.arvy@artelys.com>
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@p-arvy p-arvy requested a review from klorel November 23, 2023 10:51
Copy link
Contributor

@klorel klorel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@annetill annetill merged commit 93049c1 into main Nov 23, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Roadmap
3 participants