-
Notifications
You must be signed in to change notification settings - Fork 47
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 string representation to log level #49
Changes from 2 commits
43ff653
7f7c027
19b2fbe
682804b
8f4db84
c95e576
32af090
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,11 @@ import "unsafe" | |
|
||
type LogLevel int | ||
|
||
// https://github.com/FFmpeg/FFmpeg/blob/release/5.1/libavutil/log.c#L268 | ||
func (l LogLevel) String() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you move this function below constants? |
||
return C.GoString(C.get_level_str(C.int(l))) | ||
} | ||
|
||
// https://github.com/FFmpeg/FFmpeg/blob/n5.0/libavutil/log.h#L162 | ||
const ( | ||
LogLevelQuiet = LogLevel(C.AV_LOG_QUIET) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ func TestLog(t *testing.T) { | |
lis = append(lis, logItem{ | ||
fmt: fmt, | ||
l: l, | ||
lString: l.String(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remove |
||
msg: msg, | ||
}) | ||
}) | ||
|
@@ -31,16 +32,19 @@ func TestLog(t *testing.T) { | |
{ | ||
fmt: "warning", | ||
l: astiav.LogLevelWarning, | ||
lString: "warning", | ||
msg: "warning", | ||
}, | ||
{ | ||
fmt: "error", | ||
l: astiav.LogLevelError, | ||
lString: "error", | ||
msg: "error", | ||
}, | ||
{ | ||
fmt: "fatal", | ||
l: astiav.LogLevelFatal, | ||
lString: "fatal", | ||
msg: "fatal", | ||
}, | ||
}, lis) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the comment here?