Log Message in Function throws error on save

When I add the Log Message widget into my function I’m getting the following error:

image

error CS0122: 'FunctionBase<ErpContext, FunctionInput, FunctionOutput>.Log(BusinessObjectMessageType, string)' is inaccessible due to its protection level

I’m assuming this is a bug and there’s nothing I can do about it (2022.2.9)?

yes, looks like a bug, you should report it

1 Like

Thanks. I did. Just wanted to see if anybody else had seen it.

Doug as it turns out someone has. Perusing hte inbound bug list I just rejected yours. Took a bit but I tracked down PRB0255092 reported earlier this year. It has been fixed in 2023.1

2 Likes

Is it any workaround for it? How does the code of this widget looks like? I mean if someone with version 2023.1 could check it will be really nice :slight_smile: Just add the test function with the widget and then dump sources and see how the code looks like.

I found that the workaround is to add this line of code

Ice.Diagnostics.Log.WriteEntry("Log message");

Maybe it has some additional params but I didn’t test it. It was enough just to save log.