{ $description "Causes the word to log its input values and any errors it throws."
$nl
"If the word is not executed in a dynamic scope established by " { $link with-logging } ", its behavior is unchanged, and any errors it throws are passed to the caller."
$nl
"If called from a logging context, its input values are logged, and if it throws an error, the error is logged and the word returns normally. Any inputs are popped from the stack and " { $link f } " is pushed in place of each output." } ;
{ $values { "name""a new word name" } { "level""a log level" } }
{ $description "Creates a word with stack effect " { $snippet "( object -- )" } " which logs its input and does nothing else." } ;
ARTICLE: "logging.messages""Logging messages"
"Logging messages explicitly:"
{ $subsection log-message }
{ $subsection log-error }
{ $subsection log-critical }
"A utility for defining words which just log and do nothing else:"
{ $subsection POSTPONE:LOG: }
"Annotating words to log; this uses the " { $link "tools.annotations" } " feature:"
{ $subsection add-input-logging }
{ $subsection add-output-logging }
{ $subsection add-error-logging } ;
HELP:rotate-logs
{ $description "Rotates all logs. The highest numbered log file in each log directory is deleted, and each file is renamed so that its number increments by one. Subsequent logging calls will create a new #1 log file. This keeps log files from getting too large and makes them easier to search." } ;
HELP:close-logs
{ $description "Closes all open log streams. Subsequent logging will re-open the streams. This should be used before moving or deleting log files." } ;
"The " { $vocab-link "logging.server" } " vocabulary implements a concurrent log server using " { $vocab-link "concurrency.messaging" } ". User code never interacts with the server directly, instead it uses the words in the " { $link "logging" } " vocabulary. The server is used to synchronize access to log files and ensure that log rotation can proceed in an orderly fashion."