Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a hardcoded timestamp does not contain milli- or nanoseconds in any format #212

Open
vitalz opened this issue Nov 6, 2021 · 0 comments
Open

Comments

@vitalz
Copy link

vitalz commented Nov 6, 2021

Expected behavior

Timestamp should have nanoseconds by default or it should be possible to customise timestamp.

Actual behavior

There are only seconds on a time value. For example there is a log line:

2021-11-06T18:47:14+0300 info

Steps to reproduce

  1. Just use StreamLogHandler.standardOutput at LoggingSystem.bootstrap

There is minimal reproducer code

        LoggingSystem.bootstrap{ label in
            var logHandler = StreamLogHandler.standardOutput(label: " org.example.myproject." + label)
            logHandler.logLevel = Logger.Level.debug
            return logHandler
        }

SwiftLog version (tag)

1.4.2
This issue also affects all versions before it.

Swift & OS version

Swift:

vital@Vitals-MacBook-Air ~ % swift --version && uname -a
swift-driver version: 1.26.9 Apple Swift version 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)
Target: arm64-apple-macosx11.0
Darwin Vitals-MacBook-Air.local 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:38 PDT 2021; root:xnu-7195.141.8~1/RELEASE_ARM64_T8101 arm64
vital@Vitals-MacBook-Air ~ %

Docker container (Linux Ubuntu)

root@1765fec3b27c:/usr/src# swift --version && uname -a
Swift version 5.3 (swift-5.3-RELEASE)
Target: x86_64-unknown-linux-gnu
Linux 1765fec3b27c 5.10.47-linuxkit #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@1765fec3b27c:/usr/src

Code line contains a bug

There is a place where timestamp is hardcoded:
source

@vitalz vitalz changed the title a hardcoded timestamp does not contain mili- or nanoseconds in any format a hardcoded timestamp does not contain milli- or nanoseconds in any format Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant