Logic is the study of argument, and in particular the principles of proper reasoning or good argument. Regarded as a branch both of philosophy and of mathematics. It was pioneered by Aristotle. Although it is possible that Aristotle himself had been taught by someone else, the earliest study of reasoning can be attributed to Aristotle. Aristotle and his followers held that two of the most important principles of logic are the law of non-contradiction and the law of excluded middle; today, some other axioms or inference rules would be held to be at least as important. The ultimate goal of logic, if it can be said to have a goal, is valid argumentation and to avoid logical fallacy.
Logic as a science defines the structure of statement and argument and defines formulae by which these are codified. Implicit in a study of logic is the understanding of what makes a good argument and what arguments are fallacious. Students of traditional logic--which studied standards of definition as well as of argument--were often made to memorize certain argument forms so that they could more easily create better arguments and disprove weaker ones thrown against them. The Jesuits emphasized this so highly, that their students were required to take part in a structured argument session with their peers.
Mathematical logic or symbolic logic has changed this somewhat by axiomatizing logic and presenting all argument in the form of symbolic strings with very highly constrained forms that represent different statements. The rules of argumentation then are codified as legal transformations on these strings and the allowable starting points (the so-called axioms). Kurt Gödel in the 1930's proved his celebrated incompleteness theorem and thus derailed the idea that all of reasoned thought could be axiomatized. This sea-change had been foreshadowed by the work of Bertrand Russell and Alfred North Whitehead in mathematics. At roughly the same time, Alonzo Church, Andrei Andreevich Markov, Alan Turing and others were realizing that all sufficiently powerful formal models of computation were equivalent. This led to the computational equivalent of the incompleteness theorem, the Halting Problem.