MagFlux: - modbus_master_csharp re-import
This commit is contained in:
@@ -77,6 +77,26 @@ namespace XYLEM.Base.Files
|
||||
return nameTxt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Automated get function name for the function calling this
|
||||
/// Used for automating getting a function name to write in a log
|
||||
/// </summary>
|
||||
/// <param name="inclMsg">Add extra message to log with function name </param>
|
||||
/// <returns>"[CALLING_FUNCTION_NAME]() -> [inclMsg]"</returns>
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static string GetCurrentStaticMethod(string inclMsg = null)
|
||||
{
|
||||
var st = new StackTrace();
|
||||
var sf = st.GetFrame(1);
|
||||
|
||||
var nameTxt = $"{sf.GetMethod().Name}()";
|
||||
if (!String.IsNullOrEmpty(inclMsg))
|
||||
{
|
||||
nameTxt += " -> " + inclMsg;
|
||||
}
|
||||
return nameTxt;
|
||||
}
|
||||
|
||||
internal void AddToLogFile(bool isError, string nameSingleLine, string infoMultibleLines)
|
||||
{
|
||||
AddToLogFile(isError, StdLogFilePath, nameSingleLine, infoMultibleLines);
|
||||
|
||||
Reference in New Issue
Block a user