Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Logging.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;

namespace BinaryNinja
{
public static partial class Core
{
/// <summary>Routes messages at or above the given level to standard output.</summary>
public static void LogToStdout(LogLevel minimumLevel)
{
NativeMethods.BNLogToStdout(minimumLevel);
}

/// <summary>Routes messages at or above the given level to standard error.</summary>
public static void LogToStderr(LogLevel minimumLevel)
{
NativeMethods.BNLogToStderr(minimumLevel);
}

/// <summary>Routes messages at or above the given level to a file.</summary>
public static bool LogToFile(LogLevel minimumLevel, string path, bool append = false)
{
if (null == path)
{
throw new ArgumentNullException(nameof(path));
}

return NativeMethods.BNLogToFile(minimumLevel, path, append);
}

/// <summary>Notifies registered listeners that their configuration may have changed.</summary>
public static void UpdateLogListeners()
{
NativeMethods.BNUpdateLogListeners();
}

/// <summary>Flushes and closes every core-managed log destination.</summary>
public static void CloseLogs()
{
NativeMethods.BNCloseLogs();
}
}
}
Loading