@@ -34,6 +34,8 @@ const { Session } = require('./session')
3434const webElement = require ( './webelement' )
3535const { isObject } = require ( './util' )
3636
37+ const log_ = logging . getLogger ( `${ logging . Type . DRIVER } .http` )
38+
3739const getAttribute = requireAtom (
3840 'get-attribute.js' ,
3941 '//javascript/node/selenium-webdriver/lib/atoms:get-attribute.js'
@@ -58,10 +60,10 @@ function requireAtom(module, bazelTarget) {
5860 } catch ( ex ) {
5961 try {
6062 const file = bazelTarget . slice ( 2 ) . replace ( ':' , '/' )
61- console . log ( `../../../bazel-bin/${ file } ` )
63+ log_ . log ( `../../../bazel-bin/${ file } ` )
6264 return require ( path . resolve ( `../../../bazel-bin/${ file } ` ) )
6365 } catch ( ex2 ) {
64- console . log ( ex2 )
66+ log_ . error ( ex2 )
6567 throw Error (
6668 `Failed to import atoms module ${ module } . If running in dev mode, you` +
6769 ` need to run \`bazel build ${ bazelTarget } \` from the project` +
@@ -153,8 +155,6 @@ const Atom = {
153155 FIND_ELEMENTS : findElements ,
154156}
155157
156- const LOG = logging . getLogger ( 'webdriver.http' )
157-
158158function post ( path ) {
159159 return resource ( 'POST' , path )
160160}
@@ -428,15 +428,15 @@ class Client {
428428 * command to execute.
429429 */
430430function buildRequest ( customCommands , command ) {
431- LOG . finest ( ( ) => `Translating command: ${ command . getName ( ) } ` )
431+ log_ . finest ( ( ) => `Translating command: ${ command . getName ( ) } ` )
432432 let spec = customCommands && customCommands . get ( command . getName ( ) )
433433 if ( spec ) {
434434 return toHttpRequest ( spec )
435435 }
436436
437437 spec = W3C_COMMAND_MAP . get ( command . getName ( ) )
438438 if ( typeof spec === 'function' ) {
439- LOG . finest ( ( ) => `Transforming command for W3C: ${ command . getName ( ) } ` )
439+ log_ . finest ( ( ) => `Transforming command for W3C: ${ command . getName ( ) } ` )
440440 let newCommand = spec ( command )
441441 return buildRequest ( customCommands , newCommand )
442442 } else if ( spec ) {
@@ -451,7 +451,7 @@ function buildRequest(customCommands, command) {
451451 * @return {!Request }
452452 */
453453 function toHttpRequest ( resource ) {
454- LOG . finest ( ( ) => `Building HTTP request: ${ JSON . stringify ( resource ) } ` )
454+ log_ . finest ( ( ) => `Building HTTP request: ${ JSON . stringify ( resource ) } ` )
455455 let parameters = command . getParameters ( )
456456 let path = buildPath ( resource . path , parameters )
457457 return new Request ( resource . method , path , parameters )
@@ -487,7 +487,7 @@ class Executor {
487487 this . customCommands_ = null
488488
489489 /** @private {!logging.Logger} */
490- this . log_ = logging . getLogger ( 'webdriver. http.Executor' )
490+ this . log_ = logging . getLogger ( ` ${ logging . Type . DRIVER } . http.Executor` )
491491 }
492492
493493 /**
0 commit comments