This content is provided AS IS for archive purposes only. Content may be out of date with no guarantee of correctness.

Logging - Topics - Hag GUI for Cobra - Static

Main Article

Logging - Topics - Hag GUI for Cobra

Hag can keep three kinds of logs to make it easier to diagnose problems. These log files (file extension ".log"), can be found in a folder called "log" in the hag base directory after a program using hag has successfully exited, calling HagFreeAll.

In left column of each log file there will be a number which shows how many milliseconds into the program the current entry is. Logging is currently done in real-time, however this should rarely produce a performance issue as Hag only updates when something happens.

Error Logging

File: err.log
Enabled By Default: TRUE

The error log is written to when hag detects an error. Errors are not always fatal, but demonstrate that a potential issue exists.

It is not recommended that you disable error logging because if errors are logged it indicates that there is something serious that needs fixing in your code or a bug in hag - in either case, further action is needed. If hag logs an error, a message box will appear when the program closes.

You can enable/disable Error Logging with the function HagEnableErrorLog.

Debug Logging

File: dbg.log
Enabled By Default: FALSE

The debug log is written to as hag starts and later by certain functions to give an overview of how hag is being used by a program.

Enabling debug logging will reduce the performance of a program, so it should not be enabled by default in a final product release. However, if a program that uses hag crashes it can be extremely valuable to run the program with debug logging enabled as the debug log file will help you pin-point the error. Debug logging can also be used to find performance issues in your program (e.g. multiple unnecessary queries).

You can enable/disable Debug Logging with the function HagEnableDebugLog.

Performance Logging

File: perf.log
Enabled By Default: TRUE

A performance log is produced when a program exits successfully. It is useful to give you an idea of how fast your program ran. I plan to add more detail to the performance reports in future.

You can enable/disable Performance Logging with the function HagEnablePerfLog.

Stay Subscribed

Follow me on twitter @golightlyb, subscribe to the RSS feed or get updates by e-mail.

You can also contact me directly - I make an effort to reply to every e-mail.


Login
v0.34.archive