FastLogger | Memory mapped logger
kandi X-RAY | FastLogger Summary
kandi X-RAY | FastLogger Summary
Memory mapped logger
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of FastLogger
FastLogger Key Features
FastLogger Examples and Code Snippets
Community Discussions
Trending Discussions on FastLogger
QUESTION
I've made this piece of code and I'm puzzled with two things:
- why do the two pieces work differently, one logging and another not?
- why does the second piece log if there is a NoLoggingT wrapper added on the
selectFoobars
?
Code:
...ANSWER
Answered 2018-Aug-03 at 14:19It seems that the logging function is assigned to the connection information itself, and createSqlPool
assigns wherever you run your createSqlitePool
in:
QUESTION
I'm willing to use the fast-logger haskell library, but i have some questions:
Function newTimedFastLogger
is explained as:
Initialize a FastLogger with timestamp attached to each message. a tuple of logger and clean up action are returned.
So, first question, what is this "clean up action" for?
Also, that function takes an IO FormattedTime
as first argument, but then we have:
type TimedFastLogger = (FormattedTime -> LogStr) -> IO ()
That's my second question, why do i have to supply a FormattedTime both when creating the TimedFastLogger and when using it?
...ANSWER
Answered 2017-Sep-18 at 15:44If you look at the source for the function you will see that the clean-up action is a call to rmLoggerSet
. The documentation for that says:
Flushing the buffers, closing the internal file information and freeing the buffers.
So that should answer your first question. You would run it when you don't need the logger anymore to make sure any state state associated with it is "cleaned up". It may do different things depending on the type of logger you are using.
For the second question IO FormattedTime
is an action which can be called by the logger whenever it needs a timestamp for a log message. So it may call it multiple times and get a different FormattedTime
. When you call newTimedFastLogger
you pass this action as the first argument and it gives you back a logger and the clean up action. So, using it would go something like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install FastLogger
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page