All articles on this site areLi huaming himiOriginal, reprinted must be explicitly noted:
Reprinted from[Heimi gamedev block]Link: http://www.himigame.com/hibernate/806.html
☞Click to subscribe☜The latest developments in this blog! Notify you of the latest blog in time!
Since the parsing and framework of the latest cocos2dx action editor was not updated, we will continue to learn about hibernate from today. Next we will explain in the second article, copy, in the second article, change the name of the first annotation project to "logforhibernate ";
First, build the log4j environment;
Step 1: The user libraries we set before will continue to add the configuration related to printing logs (PS. in fact, the log console printing is crucial for our Dev. On the one hand, we can understand the current running status and find the source of the bug in real time ~, On the other hand, log4j logs can be used for us). Add the following jar package to myhibernate of himi (Custom User libraries ):
First, himi myhibernate Delete the slf4-nop-1.5.8.jar package, and then replace it with the implementation of log4j the first jar package as follows:
First jar package/apache-log4j-1.2.15/log4j-1.2.15.jar
Continue adding the second jar package/slf4j-1.5.8/slf4j-1.5.8/slf4j-log4j12-1.5.8.jar
(This slf4j-log4j12-1.5.8.jar is actually converting slf4j into the "adapter" of log4j logs ";)
Next, we need to configure the log4j configuration file. The default configuration file name is "log4j. properties"
You do not need to create it manually. You can obtain it directly in the following path:
/Hibernate-distribution-3.3.2.GA/project/etc/log4j. Properties
Copy to the project. cfg. XML "placed in the same level of directory, OK, directly run the project observation console, you will find a lot of debug information, some of which we cannot use first, OK, open log4j. the properties configuration file is changed to the following:
12345678910111213141516171819202122232425 |