webdriver_logger.d.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /// <reference types="node" />
  2. import * as stream from 'stream';
  3. import { WebDriverCommand } from './webdriver_commands';
  4. /**
  5. * Logs WebDriver commands, transforming the command into a user-friendly description.
  6. */
  7. export declare class WebDriverLogger {
  8. logStream: stream.Writable;
  9. readonly logName: string;
  10. constructor();
  11. /**
  12. * Start logging to the specified directory. Will create a file named
  13. * 'webdriver_log_<process id>.txt'
  14. *
  15. * @param logDir The directory to create log files in.
  16. */
  17. setLogDir(logDir: string): void;
  18. /**
  19. * Logs a webdriver command to the log file.
  20. *
  21. * @param command The command to log.
  22. */
  23. logWebDriverCommand(command: WebDriverCommand): void;
  24. /**
  25. * Log an arbitrary event to the log file.
  26. *
  27. * @param msg The message to log.
  28. * @param sessionId The session id associated with the event.
  29. * @param elapsedMs How long the event took, in ms.
  30. */
  31. logEvent(msg: string, sessionId: string, elapsedMs: number): void;
  32. private renderData(command);
  33. private renderResponse(command);
  34. private timestamp();
  35. }