Logger implementation
See original GitHub issueI’m opening this issue to start discussion on vision for logging
module.
Coming from Python world and being familiar with its library, my intent for Deno logging was to emulate Python’s approach.
Its mechanism is based on:
loggers
- object to call to log something obviouslyLogRecord
- contains timestamps and metadata about message logged bylogger
handlers
- also known astransports
. Onelogger
may utilize multiple `handlers. Eg. console handler that print output to console, file handler that streams logs to file on disk.filters
- predicates that interact withLogRecords
, allowing for very granular control. Bothloggers
andhandlers
can have filtersformatters
- a function that givenLogRecord
instance returns output string
Loggers are accessed using getLogger
function, so wherever in code you do const logger = logging.getLogger('myLogger');
you get the same instance.
This page gives a nice overview how to use it in action.
One of more popular node’s logging libraries winston takes not so different approach.
I’m really interested what community expects.
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (19 by maintainers)
Top Results From Across the Web
Logger in Java | Java Logging Basics with Log4j and util
Loggers in Java are objects which trigger log events, They are created and are called in the code of the application, where they...
Read more >Logger in Java - Java Logging Example - DigitalOcean
java.util.logging.LogManager is the class that reads the logging configuration, create and maintains the logger instances. We can use this class ...
Read more >Logging in Java - GeeksforGeeks
The logger class provides methods for logging. Since LogManager is the one doing actual logging, its instances are accessed using the ...
Read more >Java Logger - Javatpoint
In Java, Logging is an API that provides the ability to trace out the errors of the applications. When an application generates the...
Read more >How to Implement Logger in Python | Analytics Vidhya - Medium
I have created logger for my program which will take input-loglevel from properties file. I will mention the log-level in the properties file....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hm… It’s possible we could provide
__LINE__
as a preprocessed symbol in deno. For the filename we could use import.meta once https://github.com/denoland/deno/issues/975 lands.I reckon
log
implementation is good enough now we can close this.