usb: getting string descriptors, minor improvements
[quarnos.git] / docs / Loggers.tex
blob880f8a5e7e040a7cb52a6970f37a87dfee0c1110
1 \documentclass[a4paper,10pt]{article}
3 \begin{document}
5 \title{\textbf{Loggers}}
6 \author{Pawel Dziepak}
7 \date{\textit{January 09, 2009}}
8 \maketitle
10 \section{Description}
11 \paragraph{}Loggers are services that can be used by other parts of the system
12 to notice user about any event that happened. Each information that can make
13 it easier to find the source of a possible bug should be sent to a logger. When
14 a message is passed to the logger, it decides if the information is worth printing
15 on the console. That helps keeping logs outputs easy to read and not flooded by
16 not important repeating messages. The decision is mainly based on the level
17 of the message which is also passed to the logger. Additionally some loggers
18 might ignore message if it is the same as the previously logged one.
19 Below, there is a list of all seven levels of importance:
20 \begin{itemize}
21 \item{\texttt{log\_critical},}
22 \item{\texttt{log\_failure},}
23 \item{\texttt{log\_error},}
24 \item{\texttt{log\_warning},}
25 \item{\texttt{log\_alert},}
26 \item{\texttt{log\_info},}
27 \item{\texttt{log\_debug}.}
28 \end{itemize}
29 \paragraph{}Messages marked as \texttt{log\_critical} are always sent to the main
30 logger's data output. Sending information with this level from loops or any other
31 repeatedly executed parts of code is \textit{highly unreccomennded}. The second
32 level \texttt{log\_failure} is very similar to the highest one, but logger performs
33 checks if messages are repeating. This is a good level to choos for important messages
34 sent from loops. These two levels are not available for user level modules.
35 \paragraph{}When message level is \texttt{log\_error}, \texttt{log\_warning} or \texttt{log\_alert}
36 the decision of the logger depends on its characteristic and current system
37 state. More information about rules that loggers follow in deciding if message
38 can be sent to the primary data output can be found in their documentation.
39 \paragraph{}Messages marked as \texttt{log\_info} are always sent to the
40 secondary data output while messages with level \texttt{log\_debug} are
41 processed only if the system was compiled with an \texttt{DEBUG} option enabled.
43 \section{Data outputs}
44 \paragraph{}Loggers usually uses two data outputs, messages that logger decided to be
45 important are sent to the main, rest of them goes to the secondary one. In
46 most cases the main data output is a device (for example screen, serial port),
47 while the secondary data output is a file where logs are saved. However it depends on
48 the logger and may vary.
50 \section{Types of loggers}
52 \subsection{Early logger}
53 \paragraph{}Early logger is used between the start of the kernel and starting tty logger. It directly
54 uses device drives, and do not need any other system feature to work. Other
55 circumstances when it can be used is a situation when a fatal kernel error occured
56 and there is risk that a message informing user might not be shown if higher-level
57 procedures are used.
59 \subsection{TTY logger}
60 \paragraph{}TTY logger is a default system logger. It shows important messages on
61 the screen and sents diagnostic ones to the serial port. This logger does not perform
62 repeating messages check.
64 \include{foot}
66 \end{document}