Skip to main content
`Ctrl`+`K`

# PetscLogHandlerCreateLegacy

Create a `PetscLogHandler` from callbacks matching PETSc’s legacy log handler callbacks

## Synopsis

    PetscErrorCode PetscLogHandlerCreateLegacy(MPI_Comm comm, PetscErrorCode (*PetscLogPLB)(PetscLogEvent e, int _i, PetscObject o1, PetscObject o2, PetscObject o3, PetscObject o4), PetscErrorCode (*PetscLogPLE)(PetscLogEvent e, int _i, PetscObject o1, PetscObject o2, PetscObject o3, PetscObject o4), PetscErrorCode (*PetscLogPHC)(PetscObject o), PetscErrorCode (*PetscLogPHD)(PetscObject o), PetscLogHandler *handler)

Collective

## Input Parameters

- comm - an MPI communicator

- PetscLogPLB - a function to call during `PetscLogHandlerEventBegin()` (or `NULL`)

- PetscLogPLE - a function to call during `PetscLogHandlerEventEnd()` (or `NULL`)

- PetscLogPHC - a function to call during `PetscLogHandlerObjectCreate()` (or `NULL`)

- PetscLogPHD - a function to call during `PetscLogHandlerObjectDestroy()` (or `NULL`)

## Output Parameter

- handler - a `PetscLogHandler`

## Calling sequence of `PetscLogPLB`

- e - a `PetscLogEvent` that is beginning

- _i - deprecated, unused

- o1 - a `PetscObject` associated with `e` (or `NULL`)

- o2 - a `PetscObject` associated with `e` (or `NULL`)

- o3 - a `PetscObject` associated with `e` (or `NULL`)

- o4 - a `PetscObject` associated with `e` (or `NULL`)

## Calling sequence of `PetscLogPLE`

- e - a `PetscLogEvent` that is beginning

- _i - deprecated, unused

- o1 - a `PetscObject` associated with `e` (or `NULL`)

- o2 - a `PetscObject` associated with `e` (or `NULL`)

- o3 - a `PetscObject` associated with `e` (or `NULL`)

- o4 - a `PetscObject` associated with `e` (or `NULL`)

## Calling sequence of `PetscLogPHC`

- o - a `PetscObject` that has just been created

## Calling sequence of `PetscLogPHD`

- o - a `PetscObject` that is about to be destroyed

## Notes

This is for transitioning from the deprecated function `PetscLogSet()` and should not be used in new code.

`PetscLogLegacyCallbacksBegin()`, which calls this function, creates and starts (`PetscLogHandlerStart()`) a log handler, should be used in almost all cases.

## See Also

Profiling

## Level

developer

## Location

src/sys/logging/handler/impls/legacy/loglegacy.c

Index of all Profiling routines
Table of Contents for all manual pages
Index of all manual pages