Patch 9.0.0979
Problem: ch_log() text can be hard to find in the log file.
Solution: Prepend "ch_log()" to the text.
Files: runtime/doc/channel.txt, src/logfile.c,
src/testdir/test_channel.vim
*** ../vim-9.0.0978/runtime/doc/channel.txt 2022-06-28 11:21:05.000000000
+0100
--- runtime/doc/channel.txt 2022-12-01 11:00:37.760725814 +0000
***************
*** 617,622 ****
--- 618,626 ----
ch_log({msg} [, {handle}]) *ch_log()*
Write String {msg} in the channel log file, if it was opened
with |ch_logfile()|.
+ The text "ch_log():" is prepended to the message to make clear
+ it came from this function call and make it easier to find in
+ the log file.
When {handle} is passed the channel number is used for the
message.
{handle} can be a Channel or a Job that has a Channel. The
*** ../vim-9.0.0978/src/logfile.c 2022-11-30 20:20:52.751228273 +0000
--- src/logfile.c 2022-12-01 10:55:49.072861399 +0000
***************
*** 177,183 ****
channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0);
#endif
! ch_log(channel, "%s", msg);
}
/*
--- 177,185 ----
channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0);
#endif
! // Prepend "ch_log()" to make it easier to find these entries in the
! // logfile.
! ch_log(channel, "ch_log(): %s", msg);
}
/*
*** ../vim-9.0.0978/src/testdir/test_channel.vim 2022-11-02
13:30:37.542314565 +0000
--- src/testdir/test_channel.vim 2022-12-01 10:58:34.428782398 +0000
***************
*** 2293,2299 ****
call ch_log('%s%s')
call ch_logfile('')
let text = readfile('Xlog')
! call assert_match("hello there", text[1])
call assert_match("%s%s", text[2])
call mkdir("Xchlogdir1", 'D')
call assert_fails("call ch_logfile('Xchlogdir1')", 'E484:')
--- 2293,2300 ----
call ch_log('%s%s')
call ch_logfile('')
let text = readfile('Xlog')
! call assert_match("start log session", text[0])
! call assert_match("ch_log(): hello there", text[1])
call assert_match("%s%s", text[2])
call mkdir("Xchlogdir1", 'D')
call assert_fails("call ch_logfile('Xchlogdir1')", 'E484:')
*** ../vim-9.0.0978/src/version.c 2022-11-30 20:20:52.755228276 +0000
--- src/version.c 2022-12-01 10:42:56.017334532 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 979,
/**/
--
I'm in shape. Round IS a shape.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20221201110247.452EA1C06AE%40moolenaar.net.