Google-glog open-source library Analysis (2): glog usage, google-glogglog

Source: Internet
Author: User

Google-glog open-source library Analysis (2): glog usage, google-glogglog
Glog usage

  • Set symbol variables to customize log Behavior
    • For more information about how to set symbol variables, see symbol variables in glog introduction.
  • Log system initialization
    • Initialization function: google: InitGoogleLogging (argv [0])
    • The initialization parameter is generally the first command line parameter-that is, the program name.
  • You can call the function to disable the log system at the end.
    • Function for disabling logstore: google: ShutdownGoogleLogging ()
  • When the program is running, you can use command line parameters or environment variables to control the log behavior of the program.
Glog APIs:
  • Void google: InitGoogleLogging (const char * argv0)
    • Initialize the glog library. The parameter is the first command line parameter, that is, the program name.
  • Void google: ShutdownGoogleLogging ()
    • Disable glog Library
  • Void google: FlushLogFiles (LoSeverity min_severity)
    • [Thread-safe] All log messages of a specified level or above are immediately written to the log file.
  • Void google: FlushLogFilesUnsafe (LogSeverity min_severity)
    • Non-thread-Safe Output of log messages of a specified level or above, used to output necessary log messages in case of catastrophic program Problems
  • Void google: SetLogDestination (LogSeverity severity, const char * baseFilename)
    • [Thread-safe] sets the log file output at the specified level, if the baseIf filename is "", logs of this level are not output.
  • Void google: SetLogSymlink (LogSeverity severity, const char * symlinkBasename)
    • [Thread-safe] sets the soft connection of top-level log files, symlikIf basename is null, no soft connection is set.
    • If you do not call this function, the default connection name is the program name.
  • Void google: AddLogSink (LogSink * destination)
  • Void google: RemoveLogSink (LogSink * destination)
    • [Thread-safe] adding and deleting log output channels
  • Void google: SetLogFilenameExtension (const char * filename_extension)
    • [Thread-safe] adds a file extension for all log files, especially for log files set by SetLogDestination ()
    • The common practice is to use the listening port number as the log file extension.
  • Void google: SetStderrLogging (LogSeverity min_severity)
    • [Thread-safe] determines the minimum log level that is output to STDERR in addition to the log file
  • Void google: LogToStderr ()
    • [Thread-safe] setting only outputs logs to STDERR but not to log files
  • Void google: SetEmailLogging (LogSeverity min_severity, const char * address)
    • [Thread-safe] sets the minimum log level for sending mail
  • Bool google: SendEmail (const char * dest, const char * subject, const char * body)
    • [Thread-safe] Send email
  • Const std: vector & Google: GetLoggingDirectories ()
    • Get log output directory set
  • Void google: InstallFailureSignalHandler ()
    • Signal processing function. The main signal processed is SIGSEGV/SIGILL/SIGFPE/SIGBRT/SIGBUS/SIGTERM.
  • Void google: InstallFailureWriter (void (* writer) (const char * data, int size ))
    • Set the output function when the system crashes. The data does not necessarily end with '\ 0'.
  • Void google: InstallFailureFunction (void (* fail_func )())
    • Set the function called by LOG (FATAL) after the LOG message is output.

Google glog supports java

Sending/sending
 
Chinese lyrics of Oasis's Supersonic

Chinese Supersonic lyrics
Wikipedia, a free encyclopedia
Album: Definitely Maybe

Supersonic speed

I need to be myself
I want to be myself
I can't be no one else
I don't want to be like anyone else
I'm feeling supersonic
I'm enjoying the supersonic speed
Give me gin and tonic
Please give me a gin and tonic
You can have it all but how much do you want it?
You can drink it all at once, but how many drinks are enough?

You make me laugh
You make me laugh
Give me your autograph
Please give me your signature
Can I ride with you in your BMW?
Can I take a ride in your BMW?
You can sail with me in my yellow submarine
You can also join in with my yellow submarine (Note 1)

You need to find out
You have to think about it.
'Cos no one's gonna tell you what I'm on about
Because no one will tell you why
You need to find a way for what you want to say
You have to find a way to make yourself speak
But before tomorrow
But before dawn

'Cos my friend said he 'd take you home
Because my friend said he would take you home.
He sits in a corner all alone
He sat alone in the corner.
He lives under a waterfall
He lives under a waterfall.
No body can see him
Others cannot see him
No body can ever hear him call
He cannot hear his call.

You need to be yourself
You have to be yourself
You can't be no one else
Not like others
I know a girl called Elsa
I know a girl named Elsa.
She's into Alka Seltzer
She is very fascinated by Alka Seltzer (note 2)
She sniffs it through a cane on a supersonic train
She smoked it with a pipe in a supersonic train.

She made me laugh
She once made me laugh
I got her autograph
I also took her signature.
She done it with a doctor on a helicopter
She once worked with a doctor in a helicopter.
She's sniffin in her tissue
But now she sneezes with toilet paper.
Sellin 'The Big Issue
Sell magazines on the street (note 3)

And She finds out
Now she finally understands
No one's gonna tell her what I'm on about
No one wants to tell her what I said
You need to find a way for what she wants to say
You have to find a way to understand what she wants to say.
But... the remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.