> On Jun 18, 2021, at 4:26 PM, Nick Rosbrook <rosbro...@gmail.com> wrote: > > On Fri, Jun 18, 2021 at 01:21:40PM +0000, George Dunlap wrote: >> >> >>> On Jun 18, 2021, at 2:17 PM, George Dunlap <george.dun...@citrix.com> wrote: >>> >>> >>> >>>> On May 24, 2021, at 9:36 PM, Nick Rosbrook <rosbro...@gmail.com> wrote: >>>> >>>> Add some logging methods to Context to provide easy use of the >>>> Contenxt's xentoollog_logger. These are not exported, but the LogLevel >>>> type is so that a later commit can allow the Context's log level to be >>>> configurable. >>>> >>>> Becuase cgo does not support calling C functions with variable >>>> arguments, e.g. xtl_log, add an xtl_log_wrap function to the cgo preamble >>>> that accepts an already formatted string, and handle the formatting in >>>> Go. >>>> >>>> Signed-off-by: Nick Rosbrook <rosbro...@ainfosec.com> >>> >>> Looks good. One comment: >> >> Er, sorry, turns out I had rather more than one comment. Here’s one more: >> >> Is there any particular reason not to export the Ctx.Log[X]() functions? >> > No reason other than I tend to only export functions when I know they > need to be exported. My motivation for adding these at the time was to > help debug development. Would you prefer to export them then?
I don’t have a super-strong preference. I was just thinking that xl and libxl both use the same logger, so it would make sense for whatever was built on top of xenlight to use the same logger. But I guess we’d want the exported version to be able to pass in its own “context”; since it’s more work than just capitalizing the method names, I’d say go ahead and postpone that for now. Thanks, -George