Skip to content

Can logging macros call code hidden behind a function? #36236

@ChrisRackauckas

Description

@ChrisRackauckas

I was wondering if we could move the code for logging behind a function. For example, the try/catch in @warn causes issues with the code generation in Zygote. Even if that did get fixed in Zygote, the process would have to churn through less code if @warn was calling a function, and that function was given an adjoint definition that told it to ignore the code in there. So something as some as macro warn(args...) = _warn(@__MODULE__,args...) or the like would allow defining hooks on _warn that fix the issue.

@c42f @MikeInnes

Metadata

Metadata

Assignees

No one assigned

    Labels

    loggingThe logging framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions