bajo 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,7 @@ function format (...args) {
20
20
  const { ns, msg, params, opts } = prep(args)
21
21
  if (!msg) return ''
22
22
  const i18n = get(this, 'bajoI18N.instance')
23
+ const dayjs = get(this, 'bajo.helper')
23
24
  if (i18n) {
24
25
  if (isPlainObject(params[0])) {
25
26
  const ctx = merge({}, params[0] ?? {}, { ns })
@@ -34,7 +35,9 @@ function format (...args) {
34
35
  }
35
36
  return i18n.t(msg, { ns, pkg: opts.pkg, postProcess: 'sprintf', sprintf: params })
36
37
  }
37
- return sprintf(msg, ...params)
38
+ let text = sprintf(msg, ...params)
39
+ if (opts.showDatetime && dayjs) text = `[${dayjs().toISOString()}] ${text}`
40
+ return text
38
41
  }
39
42
 
40
43
  const print = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "A framework to build a giant monstrous app rapidly",
5
5
  "main": "boot/index.js",
6
6
  "scripts": {