Re: printk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry, that was a silly mistake.

Dave

On Fri, 2004-06-11 at 14:09, Ed L Cashin wrote:
> Davidlohr Bueso A <dbueso@linuxchile.cl> writes:
> 
> > printk is much like printf, but you have to specify a priority message.
> > You can choose from:
> > KERN_NOTICE
> > KERN_DEBUG
> > KERN_INFO
> > KERN_WARNING
> > KERN_ERR
> > KERN_EMERG
> > KERN_ALERT
> > KERN_CRIT
> >
> > So you could do, printk(KERN_INFO, "%d\n", some_struct->your_field);
> 
> No comma should be after KERN_INFO.  It's a macro that expands to a
> string.  C provides the automatic concatenation of adjascent strings,
> so that saying this:
> 
>   printk("<1>" "foo\n");
> 
> ... is the same as this:
> 
>   printk("<1>foo\n");
> 

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux