README.md in akamai_ccu-1.3.9 vs README.md in akamai_ccu-1.4.0
- old
+ new
@@ -18,10 +18,13 @@
* [ccu_invalidate](#ccu_invalidate)
* [ccu_delete](#ccu_delete)
* [Bulk operation](#bulk-operation)
* [Redirecting output](#redirecting-output)
* [Overwriting options](#overwriting-options)
+ * [Logging](#logging)
+ * [Library logger](#library-logger)
+ * [CLI logger](#cli-logger)
* [Possible issues](#possible-issues)
* [Invalid timestamp](#invalid-timestamp)
* [No wildcard](#no-wildcard)
* [Mixed bulk](#mixed-bulk)
@@ -96,11 +99,11 @@
Once you've got APIs credentials, you can instantiate the secret object aimed to generate the authorization header:
```ruby
require "akamai_ccu"
# by .edgerc
-secret = AkamaiCCU::Secret.by_edgerc(".edgerc")
+secret = AkamaiCCU::Secret.by_edgerc(".edgerc") # default to ~/.edgerc
# by txt file
secret = AkamaiCCU::Secret.by_txt("tokens.txt")
# by using initializer
@@ -195,11 +198,11 @@
```
#### Redirecting output
In case you're calling the CLI from another program (like your Jenkins script), just redirect the output to your log file:
```shell
-ccu_invalidate --edgerc=~/.edgerc --cp=12345,98765 > mylog.log
+ccu_invalidate --edgerc=~/.edgerc --cp=12345,98765 >> mylog.log
```
#### Overwriting options
The CLI allows different options for the same scope on secret and contents specification. If multiple options for the same scope are provided, the program runs by assigning specific precedence rules:
@@ -226,9 +229,25 @@
This command will delete by CP codes:
```shell
ccu_delete --txt=~/tokens.txt \
--cp=12345,98765
--url=https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/main.css,https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/main.js
+```
+
+### Logging
+
+#### Library logger
+By default the `Wrapper` class accepts a logger pointing to `dev/null`.
+In case you want to replace it with yours, just use the class attribute writer:
+```ruby
+AkamaiCCU::Wrapper.logger = Logger.new(STDOUT)
+```
+
+#### CLI logger
+CLI uses a logger writing to `STDOUT` by default with an `INFO` level.
+In case you want to control the log level, just pass an environment variable to the script:
+```shell
+LOG_LEVEL=DEBUG ccu_invalidate --edgerc=~/.edgerc --cp=12345,98765
```
### Possible Issues
#### Invalid timestamp