Skip to content

Homework 01-basic: 实现日志解析与 Dump - #92

Open
invincible-summer wants to merge 1 commit into
eesast:homework/01-basicfrom
invincible-summer:homework/01-basic
Open

Homework 01-basic: 实现日志解析与 Dump#92
invincible-summer wants to merge 1 commit into
eesast:homework/01-basicfrom
invincible-summer:homework/01-basic

Conversation

@invincible-summer

Copy link
Copy Markdown

暑培:队式作业提交

基本信息

  • 姓名:杨钧富
  • 班级:无51
  • 学号:2025010180

提交说明

Copilot AI lite review requested due to automatic review settings August 13, 2026 04:06
@mergify mergify Bot added the homework Homework PR, will not be merged label Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the 01-basic homework tasks by implementing parsing and dump output for request and internal log events, and adds the corresponding written report.

Changes:

  • Implemented request / internal event parsing in LineParser and added message DTOs for deserialization.
  • Implemented visitor support for dumping RequestLogEntry and InternalLogEntry as key-value pairs and wired up visitor Accept methods.
  • Added docs/01-basic/report.md and ignored .obsidian/ workspace files.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/LogParser/Visitors/KeyValueVisitor.cs Adds key-value dump output for Request/Internal log entries.
src/LogParser/Parser/LineParser.cs Implements parsing for Request/Internal events and their message shapes.
src/LogParser/Models/LogEntries.cs Implements Accept for Request/Internal entries to enable visitor dispatch.
docs/01-basic/report.md Adds homework report content for 01-basic.
.gitignore Ignores .obsidian/ directory.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +71 to +83
var exceptionspilt = internalMessage.Exception.IndexOf(": ");
if (exceptionspilt == -1)
{
throw new FormatException($"Invalid exception format: {internalMessage.Exception}");
}
return new InternalLogEntry(
LineNo: logRecord.LineNo,
Timestamp: DateTimeOffset.Parse(logRecord.Timestamp),
PodName: logRecord.PodName,
Severity: ParseSeverity(internalMessage.Severity),
ExceptionName: internalMessage.Exception.Substring(0, exceptionspilt),
ExceptionMessage: internalMessage.Exception.Substring(exceptionspilt + 2)
);
Comment thread docs/01-basic/report.md
+ 在对日志中 JSON 格式的 `message` 字段进行读取时,我们是在哪个方法内用哪几条语句判断这一行日志的种类(Call / Request / Internal)的?

```c
// 通过 LineRarse 的 ParseLine 方法
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

homework Homework PR, will not be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants