-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node: Create a locker for multiple Console.Write #2995
Comments
Wouldn't it be better to do this on neo-core namespace Neo
{
public delegate void LogEventHandler(string source, LogLevel level, object message);
public static class Utility
{
internal class Logger : ReceiveActor
{
public Logger()
{
Receive<InitializeLogger>(_ => Sender.Tell(new LoggerInitialized()));
Receive<LogEvent>(e => Log(e.LogSource, (LogLevel)e.LogLevel(), e.Message));
}
}
public static event LogEventHandler Logging;
public static Encoding StrictUTF8 { get; }
static Utility()
{
StrictUTF8 = (Encoding)Encoding.UTF8.Clone();
StrictUTF8.DecoderFallback = DecoderFallback.ExceptionFallback;
StrictUTF8.EncoderFallback = EncoderFallback.ExceptionFallback;
}
public static object ConsoleLock { get; } = new(); // Add this line
public static void Log(string source, LogLevel level, object message)
{
lock (ConsoleLock) // Add this line
Logging?.Invoke(source, level, message);
}
}
} Because the plugin you were talking about uses, |
I did find this in |
this can be closed. has one built-in |
Where is syncRoot? |
But is private, how can be used in neo-project/neo-node#905 ? |
But we also use Console outside this repo, in plugins, we should have access to it |
We can make it public and do something like #2995 |
Currently we can receive from plugins some outputs that can be mixed with the entered command. We should be able to send these results together.
Related to neo-project/neo-node#905 (comment)
We need somthing like:
In order to allow
lock(ConsoleHelper.Lock){ ... multiple out ... }
The text was updated successfully, but these errors were encountered: