aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2020-11-30 09:40:24 +0100
committerGitHub <noreply@github.com>2020-11-30 09:40:24 +0100
commitc47fed927e8fad0395266fb30c58a094e430bee0 (patch)
tree8e934b835157fe4adcb4ccb7ed4169e6d366582b /src/utils
parentfix(input): read stdin with lock (#72) (diff)
downloadsl0ppij-c47fed927e8fad0395266fb30c58a094e430bee0.tar.gz
sl0ppij-c47fed927e8fad0395266fb30c58a094e430bee0.tar.xz
sl0ppij-c47fed927e8fad0395266fb30c58a094e430bee0.zip
fic(compatibility): htop scrolling issues (#77)
* fix(compatibility): scrolling inside scroll region with 'M' esc dispatch * style(format): make rustfmt happy * fix(tests): send proper data * fix(logs): do not crash if log file doesn't exist
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/logging.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils/logging.rs b/src/utils/logging.rs
index 1af1cb06..e175050e 100644
--- a/src/utils/logging.rs
+++ b/src/utils/logging.rs
@@ -33,6 +33,17 @@ pub fn debug_log_to_file(message: String) -> io::Result<()> {
file.write_all(b"\n")
}
+pub fn debug_log_to_file_without_newline(message: String) -> io::Result<()> {
+ atomic_create_file(MOSAIC_TMP_LOG_FILE);
+ let mut file = fs::OpenOptions::new()
+ .append(true)
+ .create(true)
+ .open(MOSAIC_TMP_LOG_FILE)?;
+ file.write_all(message.as_bytes())?;
+
+ Ok(())
+}
+
pub fn debug_log_to_file_pid_0(message: String, pid: RawFd) -> io::Result<()> {
if pid == 0 {
debug_log_to_file(message)