-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
__i_am_main_script logic fixed for example.sh
added double-sourced test
- Loading branch information
1 parent
68d174c
commit 78943ef
Showing
6 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ACCPTST:STDIO_REPLACE_DATETIMES | ||
{datetime} UTC [35m[ debug][0m cli arg arg_f = () -> {tmpdir}/x | ||
{datetime} UTC [32m[ info][0m __i_am_main_script: 0 | ||
{datetime} UTC [32m[ info][0m __file: {root}/example.sh | ||
{datetime} UTC [32m[ info][0m __dir: {root} | ||
{datetime} UTC [32m[ info][0m __base: example | ||
{datetime} UTC [32m[ info][0m OSTYPE: {OSTYPE} | ||
{datetime} UTC [32m[ info][0m arg_f: {tmpdir}/x | ||
{datetime} UTC [32m[ info][0m arg_d: 0 | ||
{datetime} UTC [32m[ info][0m arg_v: 0 | ||
{datetime} UTC [32m[ info][0m arg_h: 0 | ||
{datetime} UTC [32m[ info][0m multiple lines example - line #1 | ||
{datetime} UTC [32m[ info][0m multiple lines example - line #2 | ||
{datetime} UTC [32m[ info][0m imagine logging the output of 'ls -al /path/' | ||
{datetime} UTC [35m[ debug][0m Info useful to developers for debugging the application, not useful during operations. | ||
{datetime} UTC [32m[ info][0m Normal operational messages - may be harvested for reporting, measuring throughput, etc. - no action required. | ||
{datetime} UTC [34m[ notice][0m Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required. | ||
{datetime} UTC [33m[ warning][0m Warning messages, not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full - each item must be resolved within a given time. This is a debug message | ||
{datetime} UTC [31m[ error][0m Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time. | ||
{datetime} UTC [1;31m[ critical][0m Should be corrected immediately, but indicates failure in a primary system, an example is a loss of a backup ISP connection. | ||
{datetime} UTC [1;33;41m[ alert][0m Should be corrected immediately, therefore notify staff who can fix the problem. An example would be the loss of a primary ISP connection. | ||
{datetime} UTC [1;4;5;33;41m[emergency][0m A "panic" condition usually affecting multiple apps/servers/sites. At this level it would usually notify all tech staff on call. | ||
{datetime} UTC [32m[ info][0m Cleaning up. Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -o pipefail | ||
set -o errexit | ||
set -o nounset | ||
# set -o xtrace | ||
|
||
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
__root="$(cd "$(dirname "$(dirname "$(dirname "${__dir}")")")" && pwd)" | ||
|
||
export LOG_LEVEL=7 | ||
|
||
echo "ACCPTST:STDIO_REPLACE_DATETIMES" | ||
|
||
# shellcheck source=example.sh | ||
source "${__root}/example.sh" -f /tmp/x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters