public void log(string file, int line, LogEntry.Types.Entry.Types.Level level, string message) { LogEntry.Builder newEntry = LogEntry.CreateBuilder(); newEntry.AddEntry(LogEntry.Types.Entry.CreateBuilder().SetLevel(level).SetMessage(message).Build()); LogEntry entry = newEntry.Build(); using (MemoryStream stream = new MemoryStream()) { entry.WriteTo(stream); core.log(stream.ToArray()); } }