Git Product home page Git Product logo

Comments (8)

jakowenko avatar jakowenko commented on May 22, 2024 1

I've pushed a new build that allows you to configure the time zone and time format and included the defaults in the README. Let me know if this resolves your issue.

from double-take.

erikarenhill avatar erikarenhill commented on May 22, 2024 1

Pushed some updates that should include the changes you suggested if you want to check them out.

If no DATE_TIME_FORMAT is passed then it will default to ISO 8601 and supports token-based formatting if someone would like to format it differently.

Awesome! I'm running v0.0.17 now and its working like a charm.

from double-take.

jakowenko avatar jakowenko commented on May 22, 2024

Thank you for the kind words! If you'd like to see any other features added, please let me know.

Good catch on the TZ option. I'll get that included in the docs for reference. You should be able to pass it now when the container starts. The default is America/Detroit, but I'll probably change that to UTC once the other changes go in.

I can add in the option for a date format too. Are you thinking something along the lines of this format (MM/DD/YYYY hh:mm:ss) with the ability to change it?

from double-take.

erikarenhill avatar erikarenhill commented on May 22, 2024

Hi @jakowenko and thanks for such a quick fix, I tested it and just have one minor thing to give feedback for.

I think it might be a good idea to use ISO8601 as default format, at least when using UTC as default TZ.

Easiest way to incorporate this I believe is to use 'YYYY-MM-DD[T]HH:mm:ss[Z]' as default format (or something like that), as that would give the same output as just using moment().utc().format() without parameters which defaults to iso8601. I could of course just specify this myself by using the environment variable but I think it would make sense to default to this in combination with UTC

As with MQTTv5 this seems to be sent through a "timestamp" property using ISO-8601 format (source) so if also the property name is changed to timestamp instead of time maybe its more futureproof? If I read that code correctly.
Seems to be hard finding out what's the standard to use for mqtt messages....

What do you think?

(Also when using backticks in server.js when logging version and time, the \n is actually escaped and printed instead of becoming a newline :))

from double-take.

jakowenko avatar jakowenko commented on May 22, 2024

I think using the ISO 8601 format definitely makes sense for UTC and probably just making it the default like you said. If the user wants to change this they would then have the ability to with the TIME_FORMAT variable.

Future proofing MQTT and using the timestamp property makes sense to me! I'll do a little more reading on this to make sure I understand. I didn't realize MQTT read that value to determine when the message was delivered.

I can't reproduce the \n being escaped and printed out. All of my container logs should a new line being printed. Do you see the \n when viewing the container logs or in the ./storage/messages.log file that the container writes to?

Thanks for all your suggestions, keep them coming! 😄

from double-take.

erikarenhill avatar erikarenhill commented on May 22, 2024

docker logs output do show the correct linebreaks, but the messages.log contains the \n by text
I use a Debian 10 LXC running on top of proxmox with docker-ce 19.03.15. Not a big deal though :)

from double-take.

jakowenko avatar jakowenko commented on May 22, 2024

Thanks for the clarification. I'll see if I can get that fixed.

from double-take.

jakowenko avatar jakowenko commented on May 22, 2024

Pushed some updates that should include the changes you suggested if you want to check them out.

If no DATE_TIME_FORMAT is passed then it will default to ISO 8601 and supports token-based formatting if someone would like to format it differently.

from double-take.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.