Comments (8)
Btw, maybe rename it to tracelog-usage
so it matches other modules and repos that I may create for it. Also may be easier to find it looking for tracelog
specifically
from tracelog.
So as I expected it was the async nature of TraceLog
It was indeed! now it works flawlessly :')
from tracelog.
@felix91gr, do you have a project file you can point me to? Trying to figure out how this is executed and packaged. Btw, I don't see anything obvious from the gist.
Remember that currently TraceLog is asynchronous so there is a possibility that the message did not have a chance to print before the script finished.
from tracelog.
Yes, I'll upload it to github. Gimme a couple of minutes :)
from tracelog.
Sorry for the name, but I was thinking of offering it to you as a TraceLog showcase project after I figured out how to use it :) The idea would be to show the most common use cases of the library.
If you want me to, I can change the name np 👍
from tracelog.
So as I expected it was the async nature of TraceLog. Try this (and I know it is not the right solution but it will show the issue with a script):
import Foundation
import TraceLog
TraceLog.configure(writers: [ConsoleWriter()], environment: ["LOG_ALL": "TRACE4"])
print("Hello!")
for _ in 0..<100 {
logError { "Hey, I'm logging stuff! :D" }
}
print("Goodbye!")
sleep(20)
So it would be very easy to add a sync mode for script usage.
from tracelog.
Btw, maybe rename it to tracelog-usage
It is done :)
from tracelog.
I should write something before closing the issue:
- Issue was resolved by using
Foundation.sleep
. The problem was that the call was asyncronous and I didn't realize. I was waiting for logs to happen before the program went on. Apart from that, the API was used allright :)
from tracelog.
Related Issues (8)
- Consider to reinstate the OFF log level
- Question about system logs HOT 88
- On the topic of including (or not, and how) the OSLoggers for a common API HOT 9
- Console writer and newlines HOT 4
- `logTrace` defaults to incorrect trace level if no trace level is passed.
- Add archive and/or delete to `FileWriter` rotate strategy.
- Enhance `FileWriter` on iOS to only write when protected data is available. 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 tracelog.