mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-08 16:33:07 +00:00
Sets log level at autoclient startup
This commit is contained in:
parent
855b627823
commit
f33e343432
@ -51,6 +51,22 @@ namespace CodexClient
|
||||
return mapper.Map(OnCodex(api => api.GetDebugInfoAsync()));
|
||||
}
|
||||
|
||||
public void SetLogLevel(string logLevel)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnCodex(async api =>
|
||||
{
|
||||
await api.SetDebugLogLevelAsync(logLevel);
|
||||
return string.Empty;
|
||||
});
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.Error("Failed to set log level: " + exc);
|
||||
}
|
||||
}
|
||||
|
||||
public string GetSpr()
|
||||
{
|
||||
return CrashCheck(() =>
|
||||
|
||||
@ -11,6 +11,7 @@ namespace CodexClient
|
||||
string GetImageName();
|
||||
string GetPeerId();
|
||||
DebugInfo GetDebugInfo(bool log = false);
|
||||
void SetLogLevel(string logLevel);
|
||||
string GetSpr();
|
||||
DebugPeer GetDebugPeer(string peerId);
|
||||
ContentId UploadFile(TrackedFile file);
|
||||
@ -135,6 +136,11 @@ namespace CodexClient
|
||||
return debugInfo;
|
||||
}
|
||||
|
||||
public void SetLogLevel(string logLevel)
|
||||
{
|
||||
codexAccess.SetLogLevel(logLevel);
|
||||
}
|
||||
|
||||
public string GetSpr()
|
||||
{
|
||||
return codexAccess.GetSpr();
|
||||
|
||||
@ -89,6 +89,8 @@ public class Program
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
private readonly string LogLevel = "TRACE;info:discv5,providers,routingtable,manager,cache;warn:libp2p,multistream,switch,transport,tcptransport,semaphore,asyncstreamwrapper,lpstream,mplex,mplexchannel,noise,bufferstream,mplexcoder,secure,chronosstream,connection,websock,ws-session,muxedupgrade,upgrade,identify,contracts,clock,serde,json,serialization,JSONRPC-WS-CLIENT,JSONRPC-HTTP-CLIENT,codex,repostore";
|
||||
|
||||
private CodexWrapper CreateCodexWrapper(string endpoint)
|
||||
{
|
||||
var splitIndex = endpoint.LastIndexOf(':');
|
||||
@ -103,6 +105,9 @@ public class Program
|
||||
|
||||
var instance = CodexInstance.CreateFromApiEndpoint("[AutoClient]", address, EthAccountGenerator.GenerateNew());
|
||||
var node = app.CodexNodeFactory.CreateCodexNode(instance);
|
||||
|
||||
node.SetLogLevel(LogLevel);
|
||||
|
||||
return new CodexWrapper(app, node);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user