Ejemplo n.º 1
0
        /// <summary>
        /// Gets the full log name.
        /// See: https://cloud.google.com/logging/docs/api/reference/rest/v2/LogEntry.
        /// </summary>
        /// <param name="name">The name of the log which will be used with the project or organization
        ///     to create a full log name.</param>
        public string GetFullLogName(string name)
        {
            GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name));
            switch (Kind)
            {
            case LogTargetKind.Project:
                return(LogName.FromProjectLog(ProjectId, name).ToString());

            case LogTargetKind.Organization:
                return(LogName.FromOrganizationLog(OrganizationId, name).ToString());

            default:
                Debug.Assert(false, $"Unsupported location {Kind}");
                return(null);
            }
        }