mirror of
https://github.com/actions/runner.git
synced 2025-12-11 21:06:55 +00:00
@@ -155,6 +155,7 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
public static readonly string DiskSpaceWarning = "runner.diskspace.warning";
|
public static readonly string DiskSpaceWarning = "runner.diskspace.warning";
|
||||||
public static readonly string Node12Warning = "DistributedTask.AddWarningToNode12Action";
|
public static readonly string Node12Warning = "DistributedTask.AddWarningToNode12Action";
|
||||||
|
public static readonly string LogTemplateErrorsAsDebugMessages = "DistributedTask.LogTemplateErrorsAsDebugMessages";
|
||||||
public static readonly string UseContainerPathForTemplate = "DistributedTask.UseContainerPathForTemplate";
|
public static readonly string UseContainerPathForTemplate = "DistributedTask.UseContainerPathForTemplate";
|
||||||
public static readonly string AllowRunnerContainerHooks = "DistributedTask.AllowRunnerContainerHooks";
|
public static readonly string AllowRunnerContainerHooks = "DistributedTask.AllowRunnerContainerHooks";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1400,9 +1400,17 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Error(string format, params Object[] args)
|
public void Error(string format, params Object[] args)
|
||||||
|
{
|
||||||
|
/* TraceWriter should be used for logging and not creating erros. */
|
||||||
|
if (logTemplateErrorsAsDebugMessages())
|
||||||
|
{
|
||||||
|
_executionContext.Debug(string.Format(CultureInfo.CurrentCulture, format, args));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
_executionContext.Error(string.Format(CultureInfo.CurrentCulture, format, args));
|
_executionContext.Error(string.Format(CultureInfo.CurrentCulture, format, args));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Info(string format, params Object[] args)
|
public void Info(string format, params Object[] args)
|
||||||
{
|
{
|
||||||
@@ -1414,7 +1422,17 @@ namespace GitHub.Runner.Worker
|
|||||||
// todo: switch to verbose?
|
// todo: switch to verbose?
|
||||||
_executionContext.Debug(string.Format(CultureInfo.CurrentCulture, $"{format}", args));
|
_executionContext.Debug(string.Format(CultureInfo.CurrentCulture, $"{format}", args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool logTemplateErrorsAsDebugMessages()
|
||||||
|
{
|
||||||
|
if (_executionContext.Global.EnvironmentVariables.TryGetValue(Constants.Runner.Features.LogTemplateErrorsAsDebugMessages, out var logErrorsAsDebug))
|
||||||
|
{
|
||||||
|
return StringUtil.ConvertToBoolean(logErrorsAsDebug, defaultValue: false);
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static class WellKnownTags
|
public static class WellKnownTags
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user