Coder Social home page Coder Social logo

Comments (4)

bengeisler avatar bengeisler commented on July 23, 2024 1

This issue has been fixed with the latest release.

It buffers messages so that the timestamp in the filename is always valid. Additionally, it exposes the TimeInfoReady property that can be used to trigger messages only once a valid timestamp is available. See here.

from tclog.

paulbarron85 avatar paulbarron85 commented on July 23, 2024 1

As a side note, you could simplify the logic of your first logging by leveraging the built-in string builder and any-to-string casts:

_logger
	.OnCondition(bFirstScan)
        .AppendString('Initial value is ')
        .AppendAny(bInput)
	.Warning();

Only problem here is that it prints bool True as 1 and False as 0. I prefer it to print True/False.

from tclog.

bengeisler avatar bengeisler commented on July 23, 2024

The best way would be if the logger buffered these messages until the time is valid and then write them to the file. Since it already has a buffer built-in, this should be easy to implement. It always takes a few cycles until the time information is available.

Meanwhile, as a workaround, you can just use the DateTime function block as dummy because it exposes a Done property and trigger your logging once it becomes true. The same function block is used internally, so I'd expect the done bits to be in sync. See here.

I'll look into the buffering as well this weekend.

from tclog.

bengeisler avatar bengeisler commented on July 23, 2024

As a side note, you could simplify the logic of your first logging by leveraging the built-in string builder and any-to-string casts:

_logger
	.OnCondition(bFirstScan)
        .AppendString('Initial value is ')
        .AppendAny(bInput)
	.Warning();

from tclog.

Related Issues (14)

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.