Comments (4)
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.
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.
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.
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)
- Contributing guide HOT 2
- When logging many messages per cycle they do not get persisted to the file system
- Twinpack library HOT 2
- Missing references in example HOT 4
- AppendAny and AppendVariable for Int values not producing correct value HOT 3
- Twinpack registry HOT 1
- Should the logger create a Folder to store the text file if logger doesn't exist? HOT 1
- Performance HOT 2
- Question: how to log multiple Boolean transitions within one FB. HOT 1
- ErrorCodes' is no component of 'TCLOG HOT 3
- Problem with TwinCAT Build 4024.55 HOT 4
- Many error messages with TwinCat 4024.55 HOT 6
- Library Categories is missing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tclog.