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 66 - [ Promise] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )
77 - [ bluebird] ( http://bluebirdjs.com/ )
88 - [ express] ( https://www.npmjs.com/package/express )
9+ - [ fancy-log] ( https://www.npmjs.com/package/fancy-log )
910 - [ fastify] ( https://www.npmjs.com/package/fastify )
1011 - [ fstream] ( https://www.npmjs.com/package/fstream )
1112 - [ 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 {
1919 */
2020string getAStandardLoggerMethodName ( ) {
2121 result = "crit" or
22+ result = "dir" or
2223 result = "debug" or
2324 result = "error" or
2425 result = "emerg" or
@@ -159,3 +160,20 @@ private module Npmlog {
159160 }
160161 }
161162}
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 2323| tst.js:22:1:22:37 | require ... ", arg) | tst.js:22:34:22:36 | arg |
2424| tst.js:23:1:23:40 | require ... ", arg) | tst.js:23:27:23:34 | "msg %s" |
2525| 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);
2121require ( "npmlog" ) . log ( "info" , "msg %s" , arg ) ;
2222require ( "npmlog" ) . info ( "msg %s" , arg ) ;
2323require ( "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