NSLog in Plugin!!!

Discussion in 'Mac Programming' started by DeDMakar, Apr 21, 2008.

  1. DeDMakar macrumors member

    Joined:
    Mar 24, 2008
    #1
    I use example /Developer/Examples/Security/bannersample. I wish to write down processes of the app in log a file. Function NSLog gives a error. Syslog() and record in a file does not work. What to do?:confused:
     
  2. DeDMakar thread starter macrumors member

    Joined:
    Mar 24, 2008
    #2
    Code:
    #import <syslog.h>
    
    int main(int argc, char *argv[])
    {
        syslog(0, "my syslog message");
        return 0;
    }
    //Text in file /var/log/system.log
    I have solved this problem: not system.log but secure.log.

    Why I can not write down in a file?
    record in a file:

    Code:
    int TextInFile(){
    FILE *fp1;
    fp1 = fopen("/Run.log", "a");
    fprintf(fp1, "new first string enter from Main.c\n");
    fclose(fp1);
    return 0;
    }
     

Share This Page