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

Add logutil.LogByLine to avoid log truncation on logging SetRequests. #85

Merged
merged 2 commits into from
Jan 31, 2023

Conversation

wenovus
Copy link
Contributor

@wenovus wenovus commented Jan 31, 2023

Some systems have a limit. This is currently hardcoded to 15000 bytes.

I0131 14:47:31.909694 2538970 logutil.go:27] SetRequest:
I0131 14:47:31.909705 2538970 logutil.go:27] prefix:  {
I0131 14:47:31.909712 2538970 logutil.go:27]   target:  "dut"
I0131 14:47:31.909719 2538970 logutil.go:27] }
I0131 14:47:31.909726 2538970 logutil.go:27] delete:  {
I0131 14:47:31.909734 2538970 logutil.go:27]   origin:  "openconfig"
I0131 14:47:31.909741 2538970 logutil.go:27]   elem:  {
I0131 14:47:31.909748 2538970 logutil.go:27]     name:  "parent"
I0131 14:47:31.909755 2538970 logutil.go:27]   }
I0131 14:47:31.909763 2538970 logutil.go:27]   elem:  {
I0131 14:47:31.909770 2538970 logutil.go:27]     name:  "child"
I0131 14:47:31.909777 2538970 logutil.go:27]   }
I0131 14:47:31.909784 2538970 logutil.go:27]   elem:  {
I0131 14:47:31.909791 2538970 logutil.go:27]     name:  "config"
I0131 14:47:31.909799 2538970 logutil.go:27]   }
I0131 14:47:31.909806 2538970 logutil.go:27]   elem:  {
I0131 14:47:31.909813 2538970 logutil.go:27]     name:  "one"
I0131 14:47:31.909820 2538970 logutil.go:27]   }
I0131 14:47:31.909828 2538970 logutil.go:27] }
I0131 14:47:31.909835 2538970 logutil.go:27] update:  {
I0131 14:47:31.909842 2538970 logutil.go:27]   path:  {
I0131 14:47:31.909849 2538970 logutil.go:27]     origin:  "openconfig"
I0131 14:47:31.909856 2538970 logutil.go:27]     elem:  {
I0131 14:47:31.909876 2538970 logutil.go:27]       name:  "parent"
I0131 14:47:31.909881 2538970 logutil.go:27]     }
I0131 14:47:31.909886 2538970 logutil.go:27]     elem:  {
I0131 14:47:31.909891 2538970 logutil.go:27]       name:  "child"
I0131 14:47:31.909897 2538970 logutil.go:27]     }
I0131 14:47:31.909902 2538970 logutil.go:27]   }
I0131 14:47:31.909907 2538970 logutil.go:27]   val:  {
I0131 14:47:31.909912 2538970 logutil.go:27]     json_ietf_val:  "{\n  \"openconfig-simple:config\": {\n    \"one\": \"foo\"\n  }\n}"
I0131 14:47:31.909917 2538970 logutil.go:27]   }
I0131 14:47:31.909922 2538970 logutil.go:27] }
I0131 14:47:31.909927 2538970 logutil.go:27] -------delete path #0------
I0131 14:47:31.909932 2538970 logutil.go:27] /parent/child/config/one
I0131 14:47:31.909937 2538970 logutil.go:27] -------update path/value pair #0------
I0131 14:47:31.909943 2538970 logutil.go:27] /parent/child
I0131 14:47:31.909948 2538970 logutil.go:27] {
I0131 14:47:31.909953 2538970 logutil.go:27]   "openconfig-simple:config": {
I0131 14:47:31.909958 2538970 logutil.go:27]     "one": "foo"
I0131 14:47:31.909963 2538970 logutil.go:27]   }
I0131 14:47:31.909968 2538970 logutil.go:27] }

Some systems have a limit. This is currently hardcoded to 15000 bytes.
@coveralls
Copy link

coveralls commented Jan 31, 2023

Pull Request Test Coverage Report for Build 4059050107

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • 10 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 83.992%

Files with Coverage Reduction New Missed Lines %
ygnmi/gnmi.go 10 88.82%
Totals Coverage Status
Change from base Build 4057419380: 0.02%
Covered Lines: 1679
Relevant Lines: 1999

💛 - Coveralls

@wenovus wenovus merged commit 9313290 into main Jan 31, 2023
@wenovus wenovus deleted the log-by-line branch January 31, 2023 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants