// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices.Logging
{
public sealed partial class LoggingInterface
{
///
/// Set the callback function to use for SDK log messages. Any previously set callback will no longer be called.
///
///
/// the function to call when the SDK logs messages
///
/// is returned if the callback will be used for future log messages.
/// is returned if the SDK has not yet been initialized, or if it has been shut down
///
public static Result SetCallback(LogMessageFunc callback)
{
var callbackInternal = new LogMessageFuncInternal(LogMessageFuncInternalImplementation);
Helper.AddStaticCallback("LogMessageFuncInternalImplementation", callback, callbackInternal);
var funcResult = Bindings.EOS_Logging_SetCallback(callbackInternal);
return funcResult;
}
///
/// Set the logging level for the specified logging category. By default all log categories will callback for Warnings, Errors, and Fatals.
///
/// the specific log category to configure. Use to configure all categories simultaneously to the same log level.
/// the log level to use for the log category
///
/// is returned if the log levels are now in use.
/// is returned if the SDK has not yet been initialized, or if it has been shut down.
///
public static Result SetLogLevel(LogCategory logCategory, LogLevel logLevel)
{
var funcResult = Bindings.EOS_Logging_SetLogLevel(logCategory, logLevel);
return funcResult;
}
[MonoPInvokeCallback(typeof(LogMessageFuncInternal))]
internal static void LogMessageFuncInternalImplementation(ref LogMessageInternal message)
{
LogMessageFunc callback;
if (Helper.TryGetStaticCallback("LogMessageFuncInternalImplementation", out callback))
{
LogMessage messageObj;
Helper.Get(ref message, out messageObj);
callback(ref messageObj);
}
}
}
}