Skip to content
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

Do NOT emit empty log-messages #3

Open
c5253458 opened this issue May 27, 2019 · 0 comments
Open

Do NOT emit empty log-messages #3

c5253458 opened this issue May 27, 2019 · 0 comments

Comments

@c5253458
Copy link

c5253458 commented May 27, 2019

Use Case:
export logger_info logger_export; scp -p file host:/tmp/file 1> >(logger_info) 2> >(logger_error)

Situation now: even on success of scp , when nothing is written to logger_error, an error-log entry is written.

Desired: on success of scp , when nothing is written to logger_error, write no error-log entry.

Code-Change:

log() {
...
# if no message was passed, read it from STDIN
[ $# -ne 0 ] && l_msg="$@" || l_msg=cat
if [ "" = "${l_msg}" ]; then return; fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant