CodeCatching



CodeCatching

Flask Series

I asked this question on Stackoverflow and was directed to ask it here. The question is: I wanted to ask about plagiarism detection tools for source code written in C. When I searched Google the. Bargain Busting, Code Catching & Daily Deals UK. 2,058 likes 2 talking about this. We try our best to find deals and share deals. It is a passion & hobby of myself & kaye. We love our followers.

Logging

  1. So I wrote CodeCatching. It is an app that allows you to save stuff - receipts, images of important artifacts, documents, and of course, codes. This information is shared with your other owned devices (iPhone, iPod, and iPad), through your AppleID. CodeCatching does not pretend to be secure. It only a repository - a bit better than a post-it.
  2. This allows you to catch a Pokemon from a trainer. Once you catch a trainers Pokemon, the battle ends. If there are 2 or more Pokemon lef., Pokemon White 2 Nintendo DS.

Logging is used to collect and store valuable information about the application’s execution, that can be used for troubleshooting purposes. Logging includes either storing data to log files, sending it to monitoring services, Windows event logs, Unix syslogs, etc.. Information, being stored and / or sent, can be text messages, call stacks, everything application and environment related, which can be used later on for debugging.

CodeCatching

Code Catcher Challenge

One of the most common approaches used is to log in files. Below you could have a look at the logging configuration and how to use it within a Flask application:

More logging handlers that can be used are:

  • RotatingFileHandler
  • NTEventLogHandler
  • SysLogHandler

You could control the logging data format as well, helpful information how to achieve this goal can be found here.

Error Management

Flask allows to an error handler to a given HTTP status code. There are two types of errors that we will concentrate on in this blog post – application and route errors. Application errors refer to issues in the application code – catching the raised exceptions, etc.. Route errors are about missing or wrong URLs.

Route Errors

Flask provides developers with means to implement their own error handlers via the errorhandler decorator.

Where you need to specify the client or server error codes and to implement a method that returns the content of the page, plus the error code. More information can be found here.

Application Errors

You could either use try/except to handle an exception (where you know it may appear) or provide global error handler.

Example Log

Testing of the Error Handlers

Code

It is very easy to test the implemented error handlers in the Flask application.

In the next blog post I will describe how to secure your Flask application.

Code Catcher Spongebob

The complete demo application, described in this blog post, can be found here.