Skip to main content
`Ctrl`+`K`

# PetscLogLegacyCallbacksBegin

Create and start a log handler from callbacks matching the now deprecated function pointers `PetscLogPLB`, `PetscLogPLE`, `PetscLogPHC`, `PetscLogPHD`.

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscLogLegacyCallbacksBegin(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))

Logically Collective on `PETSC_COMM_WORLD`

## Input Parameters

- PetscLogPLB - A callback that will be executed by `PetscLogEventBegin()` (or `NULL`)

- PetscLogPLE - A callback that will be executed by `PetscLogEventEnd()` (or `NULL`)

- PetscLogPHC - A callback that will be executed by `PetscLogObjectCreate()` (or `NULL`)

- PetscLogPHD - A callback that will be executed by `PetscLogObjectCreate()` (or `NULL`)

## 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.

This should help migrate external log handlers to use `PetscLogHandler`, but callbacks that depend on the deprecated `PetscLogStage` datatype will have to be updated.

## See Also

Profiling, `PetscLogHandler`, `PetscLogHandlerStart()`, `PetscLogState`

## Level

advanced

## Location

src/sys/logging/plog.c

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