scholer / sublime_logging_control

Enable and adjust logging output from the standard logging library. (Plugin for Sublime Text 2/3+)
GNU General Public License v3.0
6 stars 1 forks source link

Log to hidden output panel #3

Closed pradyunsg closed 8 years ago

pradyunsg commented 8 years ago

Carried over from SublimeText/PackageDev#70...

How about adding a logging class on top of Python's logging module that writes to an output panel without showing the panel? That way, the view can be opened at will, to see the log output.

scholer commented 8 years ago

Hi, Good idea. However, instead of reinventing the wheel displaying using a panel to display messages and having a new class that saves these messages, I will just save the log messages to a file (instead of memory) and display the messages by opening the log file as any other file in sublime. If I need to sort and filter the messages, I'll use a separate log viewer app (of which there are plenty). Is there any scenario not covered by this implementation? If so, can I ask what use case you have in mind? Note that logging is generally for debugging plugins; you cannot be certain that a user will see debug messages.

scholer commented 8 years ago

OK, I've added a command to open the default log file. Note that this requires file-logging to be enabled in the configuration (logging_file_enabled). The logfile behaviour can also be configured in the settings using logging_file_rotating and logging_file_handler_kwargs (in addition to the general logging_file_fmt, logging_file_datefmt, logging_file_level, etc).

scholer commented 8 years ago

Closing issue as fixed. If you have suggestions for other ways to implement this or other features, feel free to submit PRs. :)

Kristinita commented 7 years ago

@scholer , what is logging_file_handler_kwargs setting? I not find this setting in documentation and sublime-settings file. Thanks.

Kristinita commented 7 years ago

And Verbose package, by which you write in README.MD, not working.

Thanks.

scholer commented 7 years ago

@Kristinita : logging_file_handler_kwargs is somewhat advanced and therefore intentionally left out of the documentation. If given, it must be a dict, and the dict is forwarded to the file handler when instantiated (using **logging_file_handler_kwargs). I assume people looking to explore advanced behaviour would be able to determine that from the kwargs keyword and by quickly perusing the source code. Also, please don't use unrelated issues to ask questions.