/** * Sets an option to specify (key, value) pairs that are added to the {@link * LogEntry#getLabels()} of each log entry written, except when a log entry already has a value * associated to the same key. */ public static WriteOption labels(Map<String, String> labels) { return new WriteOption(OptionType.LABELS, ImmutableMap.copyOf(labels)); } }
/** * Sets an option to specify (key, value) pairs that are added to the {@link * LogEntry#getLabels()} of each log entry written, except when a log entry already has a value * associated to the same key. */ public static WriteOption labels(Map<String, String> labels) { return new WriteOption(OptionType.LABELS, ImmutableMap.copyOf(labels)); } }
/** * Returns an option to specify a default log name (see {@link LogEntry#getLogName()}) for those * log entries that do not specify their own log name. Example: {@code syslog}. */ public static WriteOption logName(String logName) { return new WriteOption(OptionType.LOG_NAME, logName); }
/** * Returns an option to specify a default monitored resource (see {@link * LogEntry#getResource()}) for those log entries that do not specify their own resource. */ public static WriteOption resource(MonitoredResource resource) { return new WriteOption(OptionType.RESOURCE, resource); }
/** * Returns an option to specify a default log name (see {@link LogEntry#getLogName()}) for those * log entries that do not specify their own log name. Example: {@code syslog}. */ public static WriteOption logName(String logName) { return new WriteOption(OptionType.LOG_NAME, logName); }
/** * Returns an option to specify a default monitored resource (see {@link * LogEntry#getResource()}) for those log entries that do not specify their own resource. */ public static WriteOption resource(MonitoredResource resource) { return new WriteOption(OptionType.RESOURCE, resource); }