source: ammosreader/org/README.org@ 008dcb7

AmmosSource
Last change on this file since 008dcb7 was f3b78e8, checked in by Enrico Schwass <ennoausberlin@…>, 2 years ago

AMMOS_LOG_LEVEL added

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[9db2d9a]1#+OPTIONS: ^:nil
2
[7e96694]3* AmmosReader
4
5Project containing necessary File- or SocketStream-Reader to read the various datastreams of Ammos
6
7* Installation
8
[b00fbbb]9** Standard pip install (not tested on all platforms)
10
[7e96694]11#+BEGIN_SRC shell
12git clone http://gitlab.kid.local/kidzg/ammosreader.git
13cd ammosreader
14python3 -m pip install .
15#+END_SRC
16
[b00fbbb]17** Using the guix functional package manager
[7e96694]18
[b00fbbb]19First subscribe to the GUIX oai channel (see Chapter Add channel to system) in
20https://gitlab.kid.local/kidzg/guix-deployment/-/blob/master/DevOps.org)
[7e96694]21
[b00fbbb]22Then install using the guix
[7e96694]23
24#+BEGIN_SRC shell
[b00fbbb]25guix package -i python-ammosreader
[7e96694]26#+END_SRC
27
[b00fbbb]28* Usage
29
30There are two scripts, which demonstrate the usage of the ammosreader package.
31
[7e96694]32** iqdw_reader.py
33
34#+BEGIN_SRC shell
35python3 iqdw_reader.py 'path_to_iqdw_file'
36#+END_SRC
37
38** pdw_reader.py
39
40#+BEGIN_SRC shell
41python3 pdw_reader.py 'path_to_pdw_file'
42#+END_SRC
[b00fbbb]43
44To minimize depencencies of the core package other scripts (audio_reader, ammos_viewer)
45are now stored in separate packages.
46
47* Logging
48
49If you use ammosreader in your own scripts a logger can be imported and used as follows:
50
51#+BEGIN_SRC python
52from ammosreader import logger
53logger.warning("Put your warning here")
54#+END_SRC
55
[f3b78e8]56** Log-File
57
[b00fbbb]58The name of the logfile is ammos.log
59The logger uses the directory stored in the AMMOS_LOG_DIR environment variable.
[f3b78e8]60If this variable is not set, /tmp is used as default. This might change to /var/log/
61in future versions running under GUIX system.
[b00fbbb]62If the logfile is not writable, the standard logger config is used and
63the logs go directly to console (tty).
64(see ammos_logging.conf file in this repository)
[f3b78e8]65
66** Log-Level
67
68You can change the log-Level by setting the environment variable AMMOS_LOG_LEVEL.
69To turn off logging completely set the level to 'CRITICAL'
70
71#+BEGIN_SRC shell
72export AMMOS_LOG_LEVEL=CRITICAL
73#+END_SRC
74
75If the environment variable does not exist, the logging level from ammos_logging.conf is used.
Note: See TracBrowser for help on using the repository browser.