Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: v3 .NET #144

Merged
merged 16 commits into from
Jun 8, 2023
Prev Previous commit
Next Next commit
Rename logs & errors
  • Loading branch information
Meldiron committed Feb 5, 2023
commit 10cdb8ab93ee44f09843f35fe08e7366e9d86a7d
4 changes: 2 additions & 2 deletions runtimes/dotnet-6.0/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ static async Task<IResult> Execute(HttpRequest Request)
Context.Log("Unsupported log noticed. Use Context.Log() or Context.Error() for logging.");
}

OutputHeaders.Add("x-open-runtimes-logs", System.Web.HttpUtility.UrlEncode(String.Join("\n", Context._Logs.Cast<string>().ToArray())));
OutputHeaders.Add("x-open-runtimes-errors", System.Web.HttpUtility.UrlEncode(String.Join("\n", Context._Errors.Cast<string>().ToArray())));
OutputHeaders.Add("x-open-runtimes-logs", System.Web.HttpUtility.UrlEncode(String.Join("\n", Context.Logs.Cast<string>().ToArray())));
OutputHeaders.Add("x-open-runtimes-errors", System.Web.HttpUtility.UrlEncode(String.Join("\n", Context.Errors.Cast<string>().ToArray())));

return new CustomResponse(Output.Body, Output.StatusCode, OutputHeaders);
}
8 changes: 4 additions & 4 deletions runtimes/dotnet-6.0/src/RuntimeContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class RuntimeContext
public RuntimeRequest Req { get; set; }
public RuntimeResponse Res { get; set; }

public ArrayList _Logs = new ArrayList();
public ArrayList _Errors = new ArrayList();
public ArrayList Logs = new ArrayList();
Meldiron marked this conversation as resolved.
Show resolved Hide resolved
public ArrayList Errors = new ArrayList();

public RuntimeContext(RuntimeRequest Req, RuntimeResponse Res)
{
Expand All @@ -18,12 +18,12 @@ public RuntimeContext(RuntimeRequest Req, RuntimeResponse Res)

public void Log(object Message)
{
this._Logs.Add(Message.ToString());
this.Logs.Add(Message.ToString());
}

public void Error(object Message)
{
this._Errors.Add(Message.ToString());
this.Errors.Add(Message.ToString());
}
}
}
Expand Down