Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the numbers in the square brackets in NSLog() output?

What is the stuff between the [] in the log message below? I get this in my iPhone app, and I have no idea where the message is coming from. My first guess would be a line number, but which file would it be in?

2010-10-19 08:56:12.006 Encore[376:6907]
like image 576
Robbie Avatar asked Oct 19 '10 13:10

Robbie


People also ask

What do the square brackets mean in the CSV file arguments?

The square brackets indicate that these arguments are optional. You can leave them out. So, in this case you are only required to pass the csvfile argument to csv.DictReader. If you would pass a second parameter, it would be interpreted as the fieldnames arguments.

What do square brackets mean in API documentation?

Usually in api documentation square brackets mean optional. I would think they mean the same here. Show activity on this post. This is actually a subset of the widely used notation to unambiguously describe language syntax called Backus-Naur Form (see Wikipedia article for details). Show activity on this post.

What is the best citation style with numbers in brackets?

Citation styles with numbers in brackets. 1 #1 Vancouver. The Vancouver style is a numeric citation system used in biomedical, health and other science publications. This style consists of ... 2 #2 IEEE. 3 #3 ACM. 4 #4 Physical Review Letters. 5 #5 Elsevier. More items

Do I have to create a reference list with numbers in brackets?

Some of the most notorious journals that use citation styles with numbers in brackets are: Elsevier, Physical Review Letters, and PubMed. ✍️ Do I have to create a reference list with numbers in brackets manually? You can, but you don't have to.


2 Answers

The first number is the process ID, the second is the logging thread's Mach port. A desktop example:

2010-10-19 17:37:13.189 nc_init[28617:a0f] nc <CFNotificationCenter 0x10010d170 [0x7fff70d96f20]> - default <CFNotificationCenter 0x10010d2a0 [0x7fff70d96f20]>

(gdb) i thread
Thread 1 has current state "WAITING"
    Mach port #0xa0f (gdb port #0x4203)
    frame 0: main () at nc_init.m:10
    pthread ID: 0x7fff70ebfc20
    system-wide unique thread id: 0x167b49
    dispatch queue name: "com.apple.main-thread"
    dispatch queue flags: 0x0
    total user time: 13232000
    total system time: 16099000
    scaled cpu usage percentage: 0
    scheduling policy in effect: 0x1
    run state: 0x3 (WAITING)
    flags: 0x0
    number of seconds that thread has slept: 0
    current priority: 31
    max priority: 63
    suspend count: 0.

(gdb) p/x (int)mach_thread_self()
$1 = 0xa0f

Notice how 0xa0f is reported as the thread's Mach port.

like image 187
Jeremy W. Sherman Avatar answered Oct 23 '22 18:10

Jeremy W. Sherman


first number is the process ID, unsure about second, this line will precede every line thats printed to console from your application.

Possibly a NSLog(@""); is causing this.

Is your application running or has it crashed by this stage?

like image 27
Luke Mcneice Avatar answered Oct 23 '22 16:10

Luke Mcneice