trace method

On this page

trace

Logs an event that occurred during the redaction process.

def trace(self, message):
    ...
Parameter Type Description
message str The event message.

Example

from groupdocs.redaction import Redactor
from groupdocs.redaction.options import LoadOptions, RedactorSettings
from groupdocs.redaction.redactions import DeleteAnnotationRedaction

class CustomLogger:
    def __init__(self):
        self.traces = []

    def trace(self, message):
        self.traces.append(message)

logger = CustomLogger()
with Redactor("sample.docx", LoadOptions(), RedactorSettings(logger=logger)) as redactor:
    redactor.apply(DeleteAnnotationRedaction())
    # add other redactions as needed
    for msg in logger.traces:
        print("trace:", msg)

Aliases

These names call trace too, limited to the overloads listed.

Alias Accepts
trace_file trace_file(message)
trace_string trace_string(message)

See Also

On this page