.net core Google.Cloud.Logging.V2:lognameoof
我正在编写一个.Net核心实用程序,它基本上是一个包装器,将消息/日志推送到GCP Stackdriver。在Google.cloud网站上也有对代码的引用 代码如下:.net core Google.Cloud.Logging.V2:lognameoof,.net-core,google-cloud-platform,stackdriver,.net Core,Google Cloud Platform,Stackdriver,我正在编写一个.Net核心实用程序,它基本上是一个包装器,将消息/日志推送到GCP Stackdriver。在Google.cloud网站上也有对代码的引用 代码如下: using System; // Imports the Google Cloud Logging client library using Google.Cloud.Logging.V2; using Google.Cloud.Logging.Type; using System.Collections.Generic; us
using System;
// Imports the Google Cloud Logging client library
using Google.Cloud.Logging.V2;
using Google.Cloud.Logging.Type;
using System.Collections.Generic;
using Google.Api;
namespace GoogleCloudSamples
{
public class QuickStart
{
public static void Main(string[] args)
{
// Your Google Cloud Platform project ID.
string projectId = "YOUR-PROJECT-ID";
// Instantiates a client.
var client = LoggingServiceV2Client.Create();
// Prepare new log entry.
LogEntry logEntry = new LogEntry();
string logId = "my-log";
LogName logName = new LogName(projectId, logId);
LogNameOneof logNameToWrite = LogNameOneof.From(logName);
logEntry.LogName = logName.ToString();
logEntry.Severity = LogSeverity.Info;
...
我的问题是这一行
lognameof logNameToWrite=lognameof.From(logName)代码>-我收到一个错误,LogNameOneof,还有其他人能做到这一点吗?我查看了github上最近对描述此配置的更改,似乎“LogNameOneof logNameToWrite=LogNameOneof.From(logName);”已被“logEntry.LogNameAsLogName=logName;”取代。这一变化可以从4月6日进行的最新调查中看到