Fix docstring on node log.error and other SDK equivalents (#6573)
* Fix docstring of log.error across SDKs to explain non-termination * Accept PR feedback, briefer docstrings.
This commit is contained in:
parent
172fdb2e0d
commit
22f332e094
|
@ -66,8 +66,8 @@ namespace Pulumi
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Error logs a fatal error to indicate that the tool should stop processing resource
|
/// Logs a fatal condition. Consider raising an exception
|
||||||
/// operations immediately.
|
/// after calling this method to stop the Pulumi program.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task ILogger.ErrorAsync(string message, Resource? resource, int? streamId, bool? ephemeral)
|
Task ILogger.ErrorAsync(string message, Resource? resource, int? streamId, bool? ephemeral)
|
||||||
=> ErrorAsync(message, resource, streamId, ephemeral);
|
=> ErrorAsync(message, resource, streamId, ephemeral);
|
||||||
|
|
|
@ -31,15 +31,15 @@ namespace Pulumi
|
||||||
=> Deployment.InternalInstance.Logger.WarnAsync(message, resource, streamId, ephemeral);
|
=> Deployment.InternalInstance.Logger.WarnAsync(message, resource, streamId, ephemeral);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logs a fatal error to indicate that the tool should stop processing resource
|
/// Logs a fatal condition. Consider raising an exception
|
||||||
/// operations immediately.
|
/// after calling Error to stop the Pulumi program.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void Error(string message, Resource? resource = null, int? streamId = null, bool? ephemeral = null)
|
public static void Error(string message, Resource? resource = null, int? streamId = null, bool? ephemeral = null)
|
||||||
=> Deployment.InternalInstance.Logger.ErrorAsync(message, resource, streamId, ephemeral);
|
=> Deployment.InternalInstance.Logger.ErrorAsync(message, resource, streamId, ephemeral);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logs a fatal exception to indicate that the tool should stop processing resource
|
/// Logs an exception. Consider raising the exception after
|
||||||
/// operations immediately.
|
/// calling this method to stop the Pulumi program.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void Exception(Exception exception, Resource? resource = null, int? streamId = null, bool? ephemeral = null)
|
public static void Exception(Exception exception, Resource? resource = null, int? streamId = null, bool? ephemeral = null)
|
||||||
=> Error(exception.ToString(), resource, streamId, ephemeral);
|
=> Error(exception.ToString(), resource, streamId, ephemeral);
|
||||||
|
|
|
@ -69,7 +69,8 @@ func (log *logState) Warn(msg string, args *LogArgs) error {
|
||||||
return _log(log.ctx, log.engine, pulumirpc.LogSeverity_WARNING, msg, args)
|
return _log(log.ctx, log.engine, pulumirpc.LogSeverity_WARNING, msg, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logs a fatal error to indicate that the tool should stop processing resource
|
// Logs a fatal condition. Consider returning a non-nil error object
|
||||||
|
// after calling Error to stop the Pulumi program.
|
||||||
func (log *logState) Error(msg string, args *LogArgs) error {
|
func (log *logState) Error(msg string, args *LogArgs) error {
|
||||||
return _log(log.ctx, log.engine, pulumirpc.LogSeverity_ERROR, msg, args)
|
return _log(log.ctx, log.engine, pulumirpc.LogSeverity_ERROR, msg, args)
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ export function warn(msg: string, resource?: resourceTypes.Resource, streamId?:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* error logs a fatal error to indicate that the tool should stop processing resource operations immediately.
|
* error logs a fatal condition. Consider raising an exception after calling error to stop the Pulumi program.
|
||||||
*/
|
*/
|
||||||
export function error(msg: string, resource?: resourceTypes.Resource, streamId?: number, ephemeral?: boolean) {
|
export function error(msg: string, resource?: resourceTypes.Resource, streamId?: number, ephemeral?: boolean) {
|
||||||
errcnt++; // remember the error so we can suppress leaks.
|
errcnt++; // remember the error so we can suppress leaks.
|
||||||
|
|
|
@ -74,12 +74,15 @@ def warn(msg: str, resource: Optional['Resource'] = None, stream_id: Optional[in
|
||||||
|
|
||||||
def error(msg: str, resource: Optional['Resource'] = None, stream_id: Optional[int] = None, ephemeral: Optional[bool] = None):
|
def error(msg: str, resource: Optional['Resource'] = None, stream_id: Optional[int] = None, ephemeral: Optional[bool] = None):
|
||||||
"""
|
"""
|
||||||
Logs a message to the Pulumi CLI's error channel, associating it with a resource
|
Logs a message to the Pulumi CLI's error channel, associating it
|
||||||
and stream_id if provided.
|
with a resource and stream_id if provided.
|
||||||
|
|
||||||
|
Consider raising an exception after calling error to stop the Pulumi program.
|
||||||
|
|
||||||
:param str msg: The message to send to the Pulumi CLI.
|
:param str msg: The message to send to the Pulumi CLI.
|
||||||
:param Optional[Resource] resource: If provided, associate this message with the given resource in the Pulumi CLI.
|
:param Optional[Resource] resource: If provided, associate this message with the given resource in the Pulumi CLI.
|
||||||
:param Optional[int] stream_id: If provided, associate this message with a stream of other messages.
|
:param Optional[int] stream_id: If provided, associate this message with a stream of other messages.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
engine = get_engine()
|
engine = get_engine()
|
||||||
if engine is not None:
|
if engine is not None:
|
||||||
|
|
Loading…
Reference in a new issue