head	1.2;
access;
symbols
	netbsd-11-0-RC4:1.2
	netbsd-11-0-RC3:1.2
	netbsd-11-0-RC2:1.2
	netbsd-11-0-RC1:1.2
	perseant-exfatfs-base-20250801:1.2
	netbsd-11:1.2.0.40
	netbsd-11-base:1.2
	netbsd-10-1-RELEASE:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.38
	perseant-exfatfs-base:1.2
	netbsd-8-3-RELEASE:1.2
	netbsd-9-4-RELEASE:1.2
	netbsd-10-0-RELEASE:1.2
	netbsd-10-0-RC6:1.2
	netbsd-10-0-RC5:1.2
	netbsd-10-0-RC4:1.2
	netbsd-10-0-RC3:1.2
	netbsd-10-0-RC2:1.2
	netbsd-10-0-RC1:1.2
	netbsd-10:1.2.0.36
	netbsd-10-base:1.2
	netbsd-9-3-RELEASE:1.2
	cjep_sun2x-base1:1.2
	cjep_sun2x:1.2.0.34
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	netbsd-9-2-RELEASE:1.2
	cjep_staticlib_x:1.2.0.32
	cjep_staticlib_x-base:1.2
	netbsd-9-1-RELEASE:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	is-mlppp:1.2.0.30
	is-mlppp-base:1.2
	phil-wifi-20200406:1.2
	netbsd-8-2-RELEASE:1.2
	netbsd-9-0-RELEASE:1.2
	netbsd-9-0-RC2:1.2
	netbsd-9-0-RC1:1.2
	phil-wifi-20191119:1.2
	netbsd-9:1.2.0.28
	netbsd-9-base:1.2
	phil-wifi-20190609:1.2
	netbsd-8-1-RELEASE:1.2
	netbsd-8-1-RC1:1.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	netbsd-7-2-RELEASE:1.2
	pgoyette-compat-0728:1.2
	netbsd-8-0-RELEASE:1.2
	phil-wifi:1.2.0.26
	phil-wifi-base:1.2
	pgoyette-compat-0625:1.2
	netbsd-8-0-RC2:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	netbsd-8-0-RC1:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	netbsd-7-1-2-RELEASE:1.2
	pgoyette-compat:1.2.0.24
	pgoyette-compat-base:1.2
	netbsd-7-1-1-RELEASE:1.2
	matt-nb8-mediatek:1.2.0.22
	matt-nb8-mediatek-base:1.2
	perseant-stdc-iso10646:1.2.0.20
	perseant-stdc-iso10646-base:1.2
	netbsd-8:1.2.0.18
	netbsd-8-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.16
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	pgoyette-localcount-20170320:1.2
	netbsd-7-1:1.2.0.14
	netbsd-7-1-RELEASE:1.2
	netbsd-7-1-RC2:1.2
	netbsd-7-nhusb-base-20170116:1.2
	bouyer-socketcan:1.2.0.12
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	netbsd-7-1-RC1:1.2
	pgoyette-localcount-20161104:1.2
	netbsd-7-0-2-RELEASE:1.2
	localcount-20160914:1.2
	netbsd-7-nhusb:1.2.0.10
	netbsd-7-nhusb-base:1.2
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.8
	pgoyette-localcount-base:1.2
	netbsd-7-0-1-RELEASE:1.2
	netbsd-7-0:1.2.0.6
	netbsd-7-0-RELEASE:1.2
	netbsd-7-0-RC3:1.2
	netbsd-7-0-RC2:1.2
	netbsd-7-0-RC1:1.2
	netbsd-7:1.2.0.4
	netbsd-7-base:1.2
	yamt-pagecache-base9:1.2
	yamt-pagecache-tag8:1.1.4.2
	tls-earlyentropy:1.2.0.2
	tls-earlyentropy-base:1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.2
	riastradh-drm2-base3:1.2
	riastradh-drm2-base2:1.1
	riastradh-drm2-base1:1.1
	riastradh-drm2:1.1.0.6
	riastradh-drm2-base:1.1
	khorben-n900:1.1.0.10
	agc-symver:1.1.0.8
	agc-symver-base:1.1
	yamt-pagecache-base8:1.1
	yamt-pagecache:1.1.0.4
	yamt-pagecache-base7:1.1
	tls-maxphys-base:1.2
	tls-maxphys:1.1.0.2;
locks; strict;
comment	@// @;


1.2
date	2013.11.29.23.02.26;	author joerg;	state Exp;
branches;
next	1.1;
commitid	0piVEhjzOJw68efx;

1.1
date	2012.11.15.19.49.13;	author jkunz;	state Exp;
branches
	1.1.2.1
	1.1.4.1;
next	;

1.1.2.1
date	2012.11.15.19.49.13;	author jkunz;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2012.11.15.19.49.14;	author jkunz;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2014.08.19.23.46.45;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.1.4.1
date	2012.11.15.19.49.13;	author yamt;	state dead;
branches;
next	1.1.4.2;

1.1.4.2
date	2013.01.16.05.27.45;	author yamt;	state Exp;
branches;
next	1.1.4.3;

1.1.4.3
date	2014.05.22.15.44.51;	author yamt;	state Exp;
branches;
next	;
commitid	uusYhp0XZMnf7yBx;


desc
@@


1.2
log
@Fix format string use.
@
text
@/*
 * File:	Logging.cpp
 *
 * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
 * See included license file for license details.
 */

#include "Logging.h"
#include <stdarg.h>
#include <stdio.h>
#include "smart_ptr.h"

// init global logger to null
Logger * Log::s_logger = NULL;

void Logger::log(const char * fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	log(m_level, fmt, args);
	va_end(args);
}

void Logger::log(log_level_t level, const char * fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	log(level, fmt, args);
	va_end(args);
}

void Logger::log(const char * fmt, va_list args)
{
	log(m_level, fmt, args);
}

//! Allocates a temporary 1KB buffer which is used to hold the
//! formatted string.
void Logger::log(log_level_t level, const char * fmt, va_list args)
{
	smart_array_ptr<char> buffer = new char[1024];
	vsprintf(buffer, fmt, args);
	if (level <= m_filter)
	{
		_log(buffer);
	}
}

void Log::log(const char * fmt, ...)
{
	if (s_logger)
	{
		va_list args;
		va_start(args, fmt);
		s_logger->log(fmt, args);
		va_end(args);
	}
}

void Log::log(const std::string & msg)
{
	if (s_logger)
	{
		s_logger->log(msg);
	}
}

void Log::log(Logger::log_level_t level, const char * fmt, ...)
{
	if (s_logger)
	{
		va_list args;
		va_start(args, fmt);
		s_logger->log(level, fmt, args);
		va_end(args);
	}
}

void Log::log(Logger::log_level_t level, const std::string & msg)
{
	if (s_logger)
	{
		s_logger->log(level, msg);
	}
}

void StdoutLogger::_log(const char * msg)
{
	printf("%s", msg);
}

@


1.1
log
@Add elftosb tools to evbarm userland and toolchain.
Elftosb is used to create a digitaly signed "secure boot" file.
This sb file can be booted by the first stage boot loader found in
Freescale i.MX23 and i.MX28 application processors.

Copyright (c) 2004-2010 Freescale Semiconductor, Inc.
@
text
@d89 1
a89 1
	printf(msg);
@


1.1.4.1
log
@file Logging.cpp was added on branch yamt-pagecache on 2013-01-16 05:27:45 +0000
@
text
@d1 91
@


1.1.4.2
log
@sync with (a bit old) head
@
text
@a0 91
/*
 * File:	Logging.cpp
 *
 * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
 * See included license file for license details.
 */

#include "Logging.h"
#include <stdarg.h>
#include <stdio.h>
#include "smart_ptr.h"

// init global logger to null
Logger * Log::s_logger = NULL;

void Logger::log(const char * fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	log(m_level, fmt, args);
	va_end(args);
}

void Logger::log(log_level_t level, const char * fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	log(level, fmt, args);
	va_end(args);
}

void Logger::log(const char * fmt, va_list args)
{
	log(m_level, fmt, args);
}

//! Allocates a temporary 1KB buffer which is used to hold the
//! formatted string.
void Logger::log(log_level_t level, const char * fmt, va_list args)
{
	smart_array_ptr<char> buffer = new char[1024];
	vsprintf(buffer, fmt, args);
	if (level <= m_filter)
	{
		_log(buffer);
	}
}

void Log::log(const char * fmt, ...)
{
	if (s_logger)
	{
		va_list args;
		va_start(args, fmt);
		s_logger->log(fmt, args);
		va_end(args);
	}
}

void Log::log(const std::string & msg)
{
	if (s_logger)
	{
		s_logger->log(msg);
	}
}

void Log::log(Logger::log_level_t level, const char * fmt, ...)
{
	if (s_logger)
	{
		va_list args;
		va_start(args, fmt);
		s_logger->log(level, fmt, args);
		va_end(args);
	}
}

void Log::log(Logger::log_level_t level, const std::string & msg)
{
	if (s_logger)
	{
		s_logger->log(level, msg);
	}
}

void StdoutLogger::_log(const char * msg)
{
	printf(msg);
}

@


1.1.4.3
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d89 1
a89 1
	printf("%s", msg);
@


1.1.2.1
log
@file Logging.cpp was added on branch tls-maxphys on 2012-11-15 19:49:14 +0000
@
text
@d1 91
@


1.1.2.2
log
@Add elftosb tools to evbarm userland and toolchain.
Elftosb is used to create a digitaly signed "secure boot" file.
This sb file can be booted by the first stage boot loader found in
Freescale i.MX23 and i.MX28 application processors.

Copyright (c) 2004-2010 Freescale Semiconductor, Inc.
@
text
@a0 91
/*
 * File:	Logging.cpp
 *
 * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
 * See included license file for license details.
 */

#include "Logging.h"
#include <stdarg.h>
#include <stdio.h>
#include "smart_ptr.h"

// init global logger to null
Logger * Log::s_logger = NULL;

void Logger::log(const char * fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	log(m_level, fmt, args);
	va_end(args);
}

void Logger::log(log_level_t level, const char * fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	log(level, fmt, args);
	va_end(args);
}

void Logger::log(const char * fmt, va_list args)
{
	log(m_level, fmt, args);
}

//! Allocates a temporary 1KB buffer which is used to hold the
//! formatted string.
void Logger::log(log_level_t level, const char * fmt, va_list args)
{
	smart_array_ptr<char> buffer = new char[1024];
	vsprintf(buffer, fmt, args);
	if (level <= m_filter)
	{
		_log(buffer);
	}
}

void Log::log(const char * fmt, ...)
{
	if (s_logger)
	{
		va_list args;
		va_start(args, fmt);
		s_logger->log(fmt, args);
		va_end(args);
	}
}

void Log::log(const std::string & msg)
{
	if (s_logger)
	{
		s_logger->log(msg);
	}
}

void Log::log(Logger::log_level_t level, const char * fmt, ...)
{
	if (s_logger)
	{
		va_list args;
		va_start(args, fmt);
		s_logger->log(level, fmt, args);
		va_end(args);
	}
}

void Log::log(Logger::log_level_t level, const std::string & msg)
{
	if (s_logger)
	{
		s_logger->log(level, msg);
	}
}

void StdoutLogger::_log(const char * msg)
{
	printf(msg);
}

@


1.1.2.3
log
@Rebase to HEAD as of a few days ago.
@
text
@d89 1
a89 1
	printf("%s", msg);
@

