-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add logging to files #257
add logging to files #257
Conversation
src/etaoin/api.clj
Outdated
@@ -2894,6 +2894,7 @@ | |||
proxy | |||
profile | |||
headless | |||
log-files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут не очень, что файлы слиплись в одну мапу. Лучше отдельными ключами log-stdout и log-stderr
src/etaoin/api.clj
Outdated
@@ -2939,7 +2940,7 @@ | |||
|
|||
proc-args (drv/get-args @driver) | |||
_ (log/debugf "Starting process: %s" (str/join \space proc-args)) | |||
process (proc/run proc-args)] | |||
process (proc/run proc-args log-files)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут их нужно будет передать мапой, вроде
{:log-stdout log-stdout
:log-stderr log-stderr}
src/etaoin/proc.clj
Outdated
|
||
(defn get-null-file ^java.io.File | ||
[] | ||
(if-let [windows? (str/starts-with? (System/getProperty "os.name") "Windows")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут переменная windows? не нужна, поэтому просто if. Но еще лучше вынести ее на уровне def, потому что операционка не меняется в рантайме.
(def windows? ...)
(if windows?
...
...)
src/etaoin/proc.clj
Outdated
|
||
(defn get-log-file | ||
[file-path] | ||
(if file-path (io/file file-path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
положительную ветку перенести на след. строку после условия
README.md
Outdated
@@ -986,6 +986,10 @@ skipped or have nil values. Some of them, if not passed, are taken from the | |||
;; :err (aliases :error, :severe, :crit, :critical), :all. When not passed, | |||
;; :all is set. | |||
:log-level :err ;; to show only errors but not debug | |||
|
|||
;; Paths to log files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут бы уточнить, что к логам именно вебдрайвера, а то не понятно
;; Paths to the driver's log files as strings.
;; When not set, the output goes to /dev/null (or NULL on Windows)
:log-stdout "/path/to/stdout.log"
:log-stderr "/path/to/stderr.log"
src/etaoin/proc.clj
Outdated
(:import java.lang.IllegalThreadStateException | ||
java.io.IOException)) | ||
|
||
(def windows? (str/starts-with? (System/getProperty "os.name") "Windows")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут двойной пробел после with?
#fixies #125