@@ -156,9 +156,9 @@ read_sources (const char *script_file_names[],
156156} /* read_sources */
157157
158158/**
159- * JerryScript debug level (0-3).
159+ * JerryScript log level
160160 */
161- static int jerry_debug_level ;
161+ static jerry_log_level_t jerry_log_level = JERRY_LOG_LEVEL_ERROR ;
162162
163163/**
164164 * Main program.
@@ -171,7 +171,7 @@ int main (int argc, FAR char *argv[])
171171int jerry_main (int argc , char * argv [])
172172#endif
173173{
174- if (argc >= JERRY_MAX_COMMAND_LINE_ARGS )
174+ if (argc > JERRY_MAX_COMMAND_LINE_ARGS )
175175 {
176176 jerry_port_log (JERRY_LOG_LEVEL_ERROR ,
177177 "Too many command line arguments. Current maximum is %d\n" ,
@@ -204,7 +204,7 @@ int jerry_main (int argc, char *argv[])
204204 {
205205 if (++ i < argc && strlen (argv [i ]) == 1 && argv [i ][0 ] >='0' && argv [i ][0 ] <= '3' )
206206 {
207- jerry_debug_level = argv [i ][0 ] - '0' ;
207+ jerry_log_level = argv [i ][0 ] - '0' ;
208208 }
209209 else
210210 {
@@ -276,7 +276,7 @@ jerry_port_log (jerry_log_level_t level, /**< log level */
276276 const char * format , /**< format string */
277277 ...) /**< parameters */
278278{
279- if (level >= jerry_debug_level )
279+ if (level <= jerry_log_level )
280280 {
281281 va_list args ;
282282 va_start (args , format );
0 commit comments