You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Windows GUI application fails to generate a log file; the pactus.log file is missing from the data folder.
How To Reproduce
Download version v1.0.0 of the software.
Run the Windows-GUI application.
Observe that no log file is produced.
What Happened
The root cause of this issue is the use of the -H windowsgui flag during the releasing process for the Windows binary, look here.
This flag is documented here and specifies that:
On Windows, the -H windowsgui option produces a GUI binary instead of a console binary.
Using -H windowsgui detaches the console from the application.
The logging mechanism works like this: Logs are written to stderr, and then the system reads the stderr output and writes it into a file. In the absence of a console, both stdout and stderr are nullified, resulting in no log file being generated.
Solution
To resolve the issue, verify if stderr is null. If true, create a buffer writer to redirect log output from the logger to the file writer, ensuring log file creation.
Environment
Operation System: Windows
Pactus Version: 1.0.0
Go Version: 21.0
The text was updated successfully, but these errors were encountered:
Description
The Windows GUI application fails to generate a log file; the
pactus.log
file is missing from the data folder.How To Reproduce
What Happened
The root cause of this issue is the use of the
-H windowsgui
flag during the releasing process for the Windows binary, look here.This flag is documented here and specifies that:
Using
-H windowsgui
detaches the console from the application.The logging mechanism works like this: Logs are written to
stderr
, and then the system reads thestderr
output and writes it into a file. In the absence of a console, bothstdout
andstderr
are nullified, resulting in no log file being generated.Solution
To resolve the issue, verify if
stderr
is null. If true, create a buffer writer to redirect log output from the logger to the file writer, ensuring log file creation.Environment
The text was updated successfully, but these errors were encountered: