File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
test/library-tests/semmle/go/concepts/LoggerCall Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ category : minorAnalysis
3
+ ---
4
+ * Logrus' ` WithContext ` methods are no longer treated as if they output the values stored in that context to a log message.
Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ module Logrus {
15
15
}
16
16
17
17
bindingset [ result ]
18
- private string getAnEntryUpdatingMethodName ( ) {
19
- result .regexpMatch ( "With(Context|Error|Fields?|Time)" )
20
- }
18
+ private string getAnEntryUpdatingMethodName ( ) { result .regexpMatch ( "With(Error|Fields?|Time)" ) }
21
19
22
20
private class LogFunction extends Function {
23
21
LogFunction ( ) {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ func logrusCalls() {
18
18
var fields logrus.Fields = nil
19
19
var fn logrus.LogFunction = nil
20
20
var ctx context.Context
21
- tmp := logrus .WithContext (ctx ) // $ logger= ctx
21
+ tmp := logrus .WithContext (ctx ) // ctx isn't output, so no match here
22
22
tmp .Debugf (fmt , text ) // $ logger=fmt logger=text
23
23
tmp = logrus .WithError (err ) // $ logger=err
24
24
tmp .Warn (text ) // $ logger=text
You can’t perform that action at this time.
0 commit comments