File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed
src/semmle/javascript/frameworks
test/library-tests/frameworks/Logging Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 6
6
- [ Promise] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )
7
7
- [ bluebird] ( http://bluebirdjs.com/ )
8
8
- [ express] ( https://www.npmjs.com/package/express )
9
+ - [ fancy-log] ( https://www.npmjs.com/package/fancy-log )
9
10
- [ fastify] ( https://www.npmjs.com/package/fastify )
10
11
- [ fstream] ( https://www.npmjs.com/package/fstream )
11
12
- [ jGrowl] ( https://github.com/stanlemon/jGrowl )
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ abstract class LoggerCall extends DataFlow::CallNode {
19
19
*/
20
20
string getAStandardLoggerMethodName ( ) {
21
21
result = "crit" or
22
+ result = "dir" or
22
23
result = "debug" or
23
24
result = "error" or
24
25
result = "emerg" or
@@ -159,3 +160,20 @@ private module Npmlog {
159
160
}
160
161
}
161
162
}
163
+
164
+ /**
165
+ * Provides classes for working with [fancy-log](https://github.com/gulpjs/fancy-log).
166
+ */
167
+ private module Fancylog {
168
+ /**
169
+ * A call to the fancy-log logging mechanism.
170
+ */
171
+ class Fancylog extends LoggerCall {
172
+ Fancylog ( ) {
173
+ this = DataFlow:: moduleMember ( "fancy-log" , getAStandardLoggerMethodName ( ) ) .getACall ( ) or
174
+ this = DataFlow:: moduleImport ( "fancy-log" ) .getACall ( )
175
+ }
176
+
177
+ override DataFlow:: Node getAMessageComponent ( ) { result = getAnArgument ( ) }
178
+ }
179
+ }
Original file line number Diff line number Diff line change 23
23
| tst.js:22:1:22:37 | require ... ", arg) | tst.js:22:34:22:36 | arg |
24
24
| tst.js:23:1:23:40 | require ... ", arg) | tst.js:23:27:23:34 | "msg %s" |
25
25
| tst.js:23:1:23:40 | require ... ", arg) | tst.js:23:37:23:39 | arg |
26
+ | tst.js:25:1:25:35 | require ... ", arg) | tst.js:25:22:25:29 | "msg %s" |
27
+ | tst.js:25:1:25:35 | require ... ", arg) | tst.js:25:32:25:34 | arg |
28
+ | tst.js:26:1:26:39 | require ... ", arg) | tst.js:26:26:26:33 | "msg %s" |
29
+ | tst.js:26:1:26:39 | require ... ", arg) | tst.js:26:36:26:38 | arg |
30
+ | tst.js:27:1:27:40 | require ... ", arg) | tst.js:27:27:27:34 | "msg %s" |
31
+ | tst.js:27:1:27:40 | require ... ", arg) | tst.js:27:37:27:39 | arg |
32
+ | tst.js:28:1:28:40 | require ... ", arg) | tst.js:28:27:28:34 | "msg %s" |
33
+ | tst.js:28:1:28:40 | require ... ", arg) | tst.js:28:37:28:39 | arg |
34
+ | tst.js:29:1:29:41 | require ... ", arg) | tst.js:29:28:29:35 | "msg %s" |
35
+ | tst.js:29:1:29:41 | require ... ", arg) | tst.js:29:38:29:40 | arg |
Original file line number Diff line number Diff line change @@ -21,3 +21,9 @@ log("msg %s", arg);
21
21
require ( "npmlog" ) . log ( "info" , "msg %s" , arg ) ;
22
22
require ( "npmlog" ) . info ( "msg %s" , arg ) ;
23
23
require ( "npmlog" ) . verbose ( "msg %s" , arg ) ;
24
+
25
+ require ( "fancy-log" ) ( "msg %s" , arg ) ;
26
+ require ( "fancy-log" ) . dir ( "msg %s" , arg ) ;
27
+ require ( "fancy-log" ) . warn ( "msg %s" , arg ) ;
28
+ require ( "fancy-log" ) . info ( "msg %s" , arg ) ;
29
+ require ( "fancy-log" ) . error ( "msg %s" , arg ) ;
You can’t perform that action at this time.
0 commit comments