diff --git a/README.md b/README.md index cfef3c4..5e1fdfd 100644 --- a/README.md +++ b/README.md @@ -45,23 +45,22 @@ saml_tools.sh ## Environment -Besides `BIN_DIR` and `LIB_DIR` above, the following environment variables are required: +Besides `BIN_DIR` and `LIB_DIR` above, the scripts leverage the following environment variables: | Variable | | | --- | --- | | `CACHE_DIR` | A persistent HTTP cache | | `TMPDIR` | A temporary directory | | `LOG_FILE` | A persistent log file | +| `LOG_LEVEL` | The global log level [0..5] | -Some OSes define `TMPDIR` and some do not. In any case, a temporary directory is required to use these scripts. +All but `LOG_LEVEL` are REQUIRED. See the following section for more info about logging. -## Overview +Note: Some OSes define `TMPDIR` and some do not. In any case, a temporary directory is required to use these scripts. -### `cget.sh` +## Logging -Bash script `cget.sh` retrieves and caches HTTP resources on disk. A previously cached resource is retrieved via HTTP Conditional GET [RFC 7232]. If the web server responds with HTTP 200 OK, the resource is cached and written to stdout. If the web server responds with 304 Not Modified, the cached resource is output instead. - -First let's configure logging. For convenience, we will log directly to the terminal: +For convenience, we will log directly to the terminal: ```Shell $ export LOG_FILE=/dev/tty @@ -79,9 +78,15 @@ Various log levels are supported: | ERROR | 1 | | FATAL | 0 | -The default logging level is INFO (i.e., if you do not explicitly set the `LOG_LEVEL` environment variable, the value `LOG_LEVEL=3` is assumed by default). +The default logging level is INFO (i.e., if you do not explicitly set the optional `LOG_LEVEL` environment variable, the value `LOG_LEVEL=3` is assumed by default). + +## Overview + +### `cget.sh` + +Bash script `cget.sh` retrieves and caches HTTP resources on disk. A previously cached resource is retrieved via HTTP Conditional GET [RFC 7232]. If the web server responds with HTTP 200 OK, the resource is cached and written to stdout. If the web server responds with 304 Not Modified, the cached resource is output instead. -Next we define a couple of HTTP resources and a cache: +First define a couple of HTTP resources and a cache: ```Shell $ url1=http://md.incommon.org/InCommon/InCommon-metadata-preview.xml