File: LoggingStyle.md

package info (click to toggle)
mpich 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 423,384 kB
  • sloc: ansic: 1,088,434; cpp: 71,364; javascript: 40,763; f90: 22,829; sh: 17,463; perl: 14,773; xml: 14,418; python: 10,265; makefile: 9,246; fortran: 8,008; java: 4,355; asm: 324; ruby: 176; lisp: 19; php: 8; sed: 4
file content (28 lines) | stat: -rw-r--r-- 1,066 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28


* Meaning of log levels:
 - error - unexpected error and the program could not continue as usual
 - warn  - unexpected situation but the program can continue running
 - debug - small volume of logging, proportional to the number of objects created.
 - trace - larger volume of logging, in special flows during runtime
 - req   - UCP requests
 - data  - dumps every packet sent / received

* General:
 - use small letters
 - avoid using '=': "device %s" instead of "device=%s" - to allow selecting the
   value using double-click from the terminal, and searching for it in text editors.
 - print flags using characters, for exaple:
    "%c%c", (flag1 ? '1' : '-'), (flag2 ? '2' : '-') 
    
* Errors:
 - print %m (system error code) for every system call error message
 - print error message in the first place the error is detected. 
 - print the exact cause of the error and not the assumed reason, because the
   assumption may not be true on all systems / in the future.

* IB:
 - print LID as integer ("lid %d")
 - print QP numbers as hex number ("qp 0x%x")