[Cocos2d-js official documentation] 10, log, cocos2d-js document log
Api changes, new on the left and original on the right.
Cc. log unchanged cc. warn added cc. error added cc. assert <-- cc. Assert
There are several reasons for this transformation:
Examples of new APIs:
cc.log("this is a log");cc.log("this is a log for %s", "Cocos2d-html5");cc.warn("this is a waring");cc.warn("this is a waring for %s", "Cocos2d-html5");cc.error("this is an error");cc.error("this is an error for %s", "Cocos2d-html5");cc.assert(false, "this is an assert");cc.assert(false, "this is an assert for %s", "Cocos2d-html5");
Then we will definemsgCode.js
cc.msgCode = { log1 : "this is a log", log2 : "this is a log for %s", warn1 : "this is a waring", warn2 : "this is a waring for %s", error1 : "this is an error", error2 : "this is an error for %s", assert1 : "this is an assert", assert2 : "this is an assert for %s", throw1 : "this is an throw", throw2 : "this is an throw for %s", "Cocos2d-html5"}
In this way, message strings can be reused to the maximum extent and facilitate management.
Reprinted: http://www.douapp.com/post/2454
The size of one-to-one math required to be compared: 1. If 1 is less than x <10, then (the log base is the logarithm of x), and the log base is the square of x; lg
Dizzy · This indicates that the method is really cool. Isn't it lg at the bottom of log? You just wrote (lgx) 2, lgx 2, and lg (lgx ).
Limit 1 <x <10
Limit 0 <lgx <1
∴ Lglgx <0 <(lgx) ² <lgx ² <1
Log base 10 times the base 10 logarithm
Log10 (10 √ 10)
= Log 10 (10 ^ (3/2 ))
= 3/2;
Please adopt
If you agree with my answer, please adopt it in time,
~ If you agree with my answer, please click the "accept as a satisfactory answer" button in time
~~ If you ask questions on your phone, click "satisfied" in the upper-right corner of the client.
~ Your adoption is the driving force for me to move forward
~~ O (primary _ primary) O, remember to praise and adopt, help each other