mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-11-03 15:39:21 +00:00
Apply logging prefix on output from DEBUG_MEMORY
This commit is contained in:
1 parent
c5a298fa05
commit
dfdc95572a
2 files changed
+8
-2
No files matched your search
@@ -54,8 +54,8 @@ fi
|
|||||||
|
|
||||||
if isTrue "${DEBUG_MEMORY:-false}"; then
|
if isTrue "${DEBUG_MEMORY:-false}"; then
|
||||||
log "Memory usage and availability (in MB)"
|
log "Memory usage and availability (in MB)"
|
||||||
uname -pars
|
uname -pars | applyLogPrefix
|
||||||
free -m
|
free -m | applyLogPrefix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
|
|||||||
@@ -125,6 +125,12 @@ function logn() {
|
|||||||
echo -n "[init] $*"
|
echo -n "[init] $*"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Use as
|
||||||
|
# cmd | applyLogPrefix
|
||||||
|
function applyLogPrefix() {
|
||||||
|
sed 's/^/[init] /'
|
||||||
|
}
|
||||||
|
|
||||||
function log() {
|
function log() {
|
||||||
local oldState
|
local oldState
|
||||||
# The return status when listing options is zero if all optnames are enabled, non- zero otherwise.
|
# The return status when listing options is zero if all optnames are enabled, non- zero otherwise.
|
||||||
|
|||||||
Reference in new issue
Block a user