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