[bug #66134] Add a prefix to each diagnostic message to indicate if it is a warning message or an error message

Jean-Baptiste de la Tour <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/bugs/?66134>

                 Summary: Add a prefix to each diagnostic message to indicate
if it is a warning message or an error message
                   Group: findutils
               Submitter: jbdlt
               Submitted: Wed 28 Aug 2024 10:20:43 AM UTC
                Category: find
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None
           Fixed Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Wed 28 Aug 2024 10:20:43 AM UTC By: Jean-Baptiste de la Tour <jbdlt>

$ find --version
find (GNU findutils) 4.10.0


== The issue ==

The problem is present at least for these diagnostic messages but may be more
global (I have not tested it further).

link-to-link loop: 

$ ln -s link link
$ find -L -xtype l
find: ‘./link’: Too many levels of symbolic links
$ 


link-to-directory-to-link loop: 

$ ln -s . link
$ find -L -xtype l
find: File system loop detected; ‘./link’ is part of the same file system
loop as ‘.’.
$ 


directory with no permission: 

$ mkdir dir
$ chmod 000 dir
$ find -type f
find: ‘./dir’: Permission denied
$ 


The message itself does not indicate if it is a warning message or an error
message.

This has an impact on the user because:
* it indicates to the user:
	* where to find information on it
		* on
[https://www.gnu.org/software/findutils/manual/html_node/find_html/Warning-Messages.html
GNU Findutils manual / 8.1.2 Warning Messages]
		* on
[https://www.gnu.org/software/findutils/manual/html_node/find_html/Error-Messages-From-find.html
GNU Findutils manual / 12.1 Error Messages From *find*]
	* therefore: if it can be silenced with *-nowarn*
* it enables to filter diagnostic messages by message type (with *grep* —
[https://stackoverflow.com/questions/762348/how-can-i-exclude-all-permission-denied-messages-from-find#762360
see this example])

As a comparison, see the output (an extract) of the server Xorg:

Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(II) AIGLX: Suspending AIGLX clients for VT switch
(EE) client bug: timer event5 debounce: scheduled expiry is in the past
(-54ms), your system is too slow


In the opposite,
[https://www.gnu.org/software/findutils/manual/html_node/find_html/Error-Messages-From-find.html
GNU Findutils manual / 12.1 Error Messages From find] indicates that some
_error_ messages are prefixed by _"Warning:"_, example: _"Warning: filesystem
/path/foo has recently been mounted"_.

== PS ==

For _users_ reading this report, the answer is that they are _probably_ error
messages (because not removed by the *-nowarn* option — _or else_ they are
warning messages and there is a bug in *-nowarn*):

link-to-link loop:

$ ln -s link link
$ find -L -nowarn -xtype l
find: ‘./link’: Too many levels of symbolic links
$ 


link-to-directory-to-link loop:

$ ln -s . link
$ find -L -nowarn -xtype l
find: File system loop detected; ‘./link’ is part of the same file system
loop as ‘.’.
$ 


directory with no permission: 

$ mkdir dir
$ chmod 000 dir
$ find -nowarn -type f
find: ‘./dir’: Permission denied
$ 









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66134>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZs76AQAKCRCqLAuaBUf3
Tr0VAQCqVO204UtSMxkiM/SD5YpClyTg8tGun+4cIFREKboVaQEAni/fKGJQLdGg
uJijrqmJ9ypm8wGXEgmnenRmodpQRwg=
=ty/g
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.