How to output git log with the first line only?

Have you tried this? git log –oneline It’s an alias for git log –pretty=oneline –abbrev-commit, and displays the “short sha” and “short description”, for example: 9bee8857 Write more code 831fdd6e Write some code Second line of message The problem is that you are missing an empty line after the first line of your commit message. … Read more

How can I color Python logging output?

Python 3 solution, no additional packages required Define a class import logging class CustomFormatter(logging.Formatter): grey = “\x1b[38;20m” yellow = “\x1b[33;20m” red = “\x1b[31;20m” bold_red = “\x1b[31;1m” reset = “\x1b[0m” format = “%(asctime)s – %(name)s – %(levelname)s – %(message)s (%(filename)s:%(lineno)d)” FORMATS = { logging.DEBUG: grey + format + reset, logging.INFO: grey + format + reset, logging.WARNING: … Read more

How to show the last queries executed on MySQL?

For those blessed with MySQL >= 5.1.12, you can control this option globally at runtime: Execute SET GLOBAL log_output=”TABLE”; Execute SET GLOBAL general_log = ‘ON’; Take a look at the table mysql.general_log If you prefer to output to a file instead of a table: SET GLOBAL log_output = “FILE”; the default. SET GLOBAL general_log_file = … Read more

heroku – how to see all the logs

Update (thanks to dawmail333): heroku logs -n 1500 or, to tail the logs live heroku logs -t Heroku log documentation If you need more than a few thousand lines you can Use heroku’s Syslog Drains Alternatively (old method): $ heroku run rails c File.open(‘log/production.log’, ‘r’).each_line { |line| puts line }

How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?

You can subclass HandleErrorAttribute and override its OnException member (no need to copy) so that it logs the exception with ELMAH and only if the base implementation handles it. The minimal amount of code you need is as follows: using System.Web.Mvc; using Elmah; public class HandleErrorAttribute : System.Web.Mvc.HandleErrorAttribute { public override void OnException(ExceptionContext context) { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)