Logging |
Start page Previous page Next page |
n2pdf offers the function of data logging for use in the context of the evaluation of conversions. The data supplied can only be used exclusively by administrators or developers as an aid in the elimination of problems.
Activation can be done using the function N2PDFSetGlobalOption with the global option N2PDFGLOBALOPTION_LOG_ENABLED. All errors which occur or information obtained is divided into different categories based on importance. This gives you control of the level at which messages are to be logged. Control of this level is provided via the option N2PDFGLOBALOPTION_LOG_LEVEL by specifying the desired level limit.
The setting for the activation of the logging and the log level is made via the function N2PDFSetGlobalOption. The following shows the individual options for data logging. The individual values are set via <OptionID> and <OptionStr> of the N2PDFSetGlobalOption function.
N2PDFGLOBALOPTION_LOG_ENABLEDThis option enables the creation of the data log.
Example: Enable data logging Call N2PDFSetGlobalOption ( N2PDFGLOBALOPTION_LOG_ENABLED, N2PDFVALUE_TRUE, "" )
Save the log file You must enable this process in the N2PDFProcess call in order to save all of the information which has been gathered. This is done through the N2PDFVALUE_PROCESS_SAVE_LOG parameter. When this value is set, n2pdf also creates an XML file of the same name as the PDF file to be created and saves it to the same directory.
Example: Activation of the saving of all data gathered Call N2PDFProcess ( JobID, PDFFileName, N2PDFVALUE_PROCESS_SAVE_LOG )
N2PDFGLOBALOPTION_LOG_LEVELThe extent to which data is saved in the log file is dependent on the log level set. When you set a log level, all of the messages which equal or exceed this level are recorded in the log.
The order (from lowest to highest) of the log levels is:
ALL > TRACE > DEBUG > INFO > WARNING > ERROR > FATAL > OFF
Example: Setting the log level “ALL” (0) for unfiltered output of all messages Call N2PDFSetGlobalOption ( N2PDFGLOBALOPTION_LOG_LEVEL, "0", "" )
Example: Setting the log level “WARNING” (4) for the output of messages of the levels “Warning", "Error" or "Fatal" Call N2PDFSetGlobalOption ( N2PDFGLOBALOPTION_LOG_LEVEL, "4", "" )
Data logging via n2pdf.ini In addition to script controlled activation of data logging, you can also enable logging via an entry in the n2pdf.ini file.
[Setup] LogEnabled=1 LogLevel=5
The options LogEnabled and LogLevel allow you to enable logging and to set a certain level for global data logging. It is still necessary to use N2PDFProcess to save the log.
|