summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-03-17 18:33:32 -0300
committerEuAndreh <eu@euandre.org>2024-03-17 18:33:35 -0300
commit5e656cdb48d47f45dd95bf8c52060a48b912e79d (patch)
tree6b240d31b28db40116541b8fd8c642753a63219a /src
parenttests/js/hero.mjs: Add simple test for now() (diff)
downloadpapod-5e656cdb48d47f45dd95bf8c52060a48b912e79d.tar.gz
papod-5e656cdb48d47f45dd95bf8c52060a48b912e79d.tar.xz
src/hero.mjs: Log to stdout instead of stderr
The first question that this brings is: Is the output of the program useful for a downstream process? Is this logging an *output* of the program? But in this case, the answer is: yes, for both questions. A downstream program could very well be fed the output of the program via a pipe and process it, as the data being emitted is meant to be ingested. So instead of following the default "warnings ought to go to stderr" model, we acknowledge that the data is actually an *out*put, and send it to std*out*.
Diffstat (limited to 'src')
-rw-r--r--src/hero.mjs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hero.mjs b/src/hero.mjs
index d97f028..c36da68 100644
--- a/src/hero.mjs
+++ b/src/hero.mjs
@@ -32,7 +32,7 @@ export const logit = (writerFn, timestampFn, level, o) =>
export const now = () => (new Date()).toISOString();
export const makeLogger = ({
- writerFn = console.error,
+ writerFn = console.log,
timestampFn = now,
} = {}) => ({
debug: (...args) => process.env.DEBUG ?