Browse Source

Improved some of the output messages from tasks.json when compiling.
Figured out that PDFHummus doesn't do a very good job at handling errors.
Created a text file to log errors, now we have to hunt the errors down.

wes 4 years ago
parent
commit
034639c235
11 changed files with 61 additions and 5 deletions
  1. BIN
      .vs/VS CODE/v15/.suo
  2. 6 0
      .vs/VSWorkspaceState.json
  3. BIN
      .vs/slnx.sqlite
  4. 5 0
      .vscode/tasks.json
  5. 6 0
      ToDo/ToDo.txt
  6. 3 0
      hemph
  7. 31 0
      logMe
  8. BIN
      myFile.pdf
  9. 10 5
      pdfHummusTest1.cpp
  10. BIN
      pdfHummusTest1/myFile.pdf
  11. BIN
      pdfHummusTest1/pdfHummusTest1.exe

BIN
.vs/VS CODE/v15/.suo


+ 6 - 0
.vs/VSWorkspaceState.json

@@ -0,0 +1,6 @@
+{
+  "ExpandedNodes": [
+    ""
+  ],
+  "PreviewInSolutionExplorer": false
+}

BIN
.vs/slnx.sqlite


+ 5 - 0
.vscode/tasks.json

@@ -2,6 +2,11 @@
     // See https://go.microsoft.com/fwlink/?LinkId=733558
     // for the documentation about the tasks.json format
     "version": "2.0.0",
+    "presentation": {
+        "showReuseMessage": false,
+        "reveal": "silent",
+        "echo" : false
+      },
     "tasks": [
         {
         "label": "control shift B",

+ 6 - 0
ToDo/ToDo.txt

@@ -0,0 +1,6 @@
+19April20
+Successfully created a log file for errors using Gal's LogConfiguration structure. We are not sure what errors he actually keeps track of so we have to hunt for errors to log.
+Cleaned up tasks.json so there isn't a bunch of unuseful text such as "terminal will be resused message" or "execting tasks" messages. This needs to be cleaned up a little bit more
+and more useful information needs to be added. For instance, failed does not print on the same line inside the terminal.
+
+Kyle states: add one more line of code to state that your program worked as a work around for the "press any key" "error".

+ 3 - 0
hemph

@@ -0,0 +1,3 @@
+[ 16/04/2020 20:56:57 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 16/04/2020 20:57:06 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 16/04/2020 21:10:09 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf

+ 31 - 0
logMe

@@ -0,0 +1,31 @@
+[ 19/04/2020 14:41:28 ] ooogaBooga
+[ 19/04/2020 14:41:54 ] ooogaBooga
+[ 19/04/2020 14:42:05 ] ooogaBooga
+[ 19/04/2020 14:42:53 ] ooogaBooga
+[ 19/04/2020 14:43:28 ] ooogaBooga
+[ 19/04/2020 14:46:41 ] ooogaBooga
+[ 19/04/2020 14:46:50 ] ooogaBooga
+[ 19/04/2020 14:47:01 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 14:47:01 ] ooogaBooga
+[ 19/04/2020 14:52:37 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 14:52:37 ] ooogaBooga
+[ 19/04/2020 14:57:42 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 14:57:42 ] ooogaBooga
+[ 19/04/2020 15:12:22 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:12:22 ] ooogaBooga
+[ 19/04/2020 15:13:45 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:13:45 ] ooogaBooga
+[ 19/04/2020 15:13:45 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:13:45 ] ooogaBooga
+[ 19/04/2020 15:15:16 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:15:16 ] ooogaBooga
+[ 19/04/2020 15:15:41 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:15:41 ] ooogaBooga
+[ 19/04/2020 15:19:07 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:19:07 ] ooogaBooga
+[ 19/04/2020 15:19:38 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:19:38 ] ooogaBooga
+[ 19/04/2020 15:19:39 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:19:39 ] ooogaBooga
+[ 19/04/2020 15:30:09 ] OutputFile::OpenFile, Unexpected Failure. Cannot open file for writing - .\myFile.pdf
+[ 19/04/2020 15:30:09 ] ooogaBooga

BIN
myFile.pdf


+ 10 - 5
pdfHummusTest1.cpp

@@ -4,6 +4,9 @@
  *  we came upon this error, by trying to run the pdfHummusTest1.exe and the pdf file was not being created (because it was still
  *  open -> Windows locking files regardless of where they are open). This is the reason why we wanted to figure out if PDFHummus
  *  had an error logging capability and then we had to try and figure out how to use it... to be continued for next time.
+ * 19 April 2020
+ * Gal's documentation for using the logging capabilitites was old, the LogConfiguration function takes 3 parameters.
+ * Gal does not actually handle or log errors.
  */
 
 #include <stdlib.h>
@@ -12,16 +15,15 @@
 #include "PDFPage.h"
 #include "PageContentContext.h"
 #include "PDFFormXObject.h"
+#include "Trace.h"
 
 int main(){
     PDFWriter pdfWriter;
     //  PREPARE PDF DOCUMENT
     //  ********************
-    LogConfiguration test = LogConfiguration::DefaultLogConfiguration();
-    test.ShouldLog = true;
-    test.LogFileLocation = ".\\hemph";
     //  set path to output directory for new pdf
-    EStatusCode e = pdfWriter.StartPDF(".\\myFile.pdf",ePDFVersion13,test);
+    EStatusCode e = pdfWriter.StartPDF(".\\myFile.pdf",ePDFVersion13,LogConfiguration(true,true,".\\logMe"));
+    TRACE_LOG("ooogaBooga");
     if (e){
         printf ("something interesting");
     }
@@ -57,7 +59,10 @@ int main(){
     //  END PAGE, WRITE PDF.
     //  ******************** 
     pdfWriter.EndPageContentContext(pageContentContext);
-    pdfWriter.WritePageAndRelease(pdfPage);
+    EStatusCode f = pdfWriter.WritePageAndRelease(pdfPage);
+    if (f){
+        printf ("something interesting");
+    }
     pdfWriter.EndPDF();
 
 }

BIN
pdfHummusTest1/myFile.pdf


BIN
pdfHummusTest1/pdfHummusTest1.exe